diff options
author | Peter Zhu <peter@peterzhu.ca> | 2022-03-14 09:39:51 -0400 |
---|---|---|
committer | Peter Zhu <peter@peterzhu.ca> | 2022-03-14 09:45:18 -0400 |
commit | 45786667ec0b0c2af5bf2c2069246edaae2d7c30 (patch) | |
tree | 7e50653d6ef21fd8515dbbe26d772aee99d9dec6 /array.c | |
parent | 7348db866a4120b701bf28918d6fcbd4d6f07121 (diff) |
Assume that shared_root exists in rb_ary_decrement_share
All callers of rb_ary_decrement_share guarantee that
shared_root is not 0.
Diffstat (limited to 'array.c')
-rw-r--r-- | array.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -512,11 +512,9 @@ ary_double_capa(VALUE ary, long min) static void rb_ary_decrement_share(VALUE shared_root) { - if (shared_root) { - long num = ARY_SHARED_ROOT_REFCNT(shared_root) - 1; - if (num > 0) { - ARY_SET_SHARED_ROOT_REFCNT(shared_root, num); - } + long num = ARY_SHARED_ROOT_REFCNT(shared_root) - 1; + if (num > 0) { + ARY_SET_SHARED_ROOT_REFCNT(shared_root, num); } } |