summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2022-03-14 09:39:51 -0400
committerPeter Zhu <peter@peterzhu.ca>2022-03-14 09:45:18 -0400
commit45786667ec0b0c2af5bf2c2069246edaae2d7c30 (patch)
tree7e50653d6ef21fd8515dbbe26d772aee99d9dec6 /array.c
parent7348db866a4120b701bf28918d6fcbd4d6f07121 (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.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/array.c b/array.c
index ae2ba38cbe..53e69f2a32 100644
--- a/array.c
+++ b/array.c
@@ -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);
}
}