From c8d641998532c29714529e3c2e721bb1499658d5 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Fri, 18 Aug 2023 10:25:36 -0400 Subject: [PATCH] Refactor ary_make_partial --- array.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/array.c b/array.c index 74a38ef3a9..b4d4cd5bff 100644 --- a/array.c +++ b/array.c @@ -1200,7 +1200,6 @@ ary_make_partial(VALUE ary, VALUE klass, long offset, long len) FL_SET_EMBED(result); ary_memcpy(result, 0, len, RARRAY_CONST_PTR(ary) + offset); ARY_SET_EMBED_LEN(result, len); - return result; } else { VALUE shared = ary_make_shared(ary); @@ -1215,9 +1214,10 @@ ary_make_partial(VALUE ary, VALUE klass, long offset, long len) ARY_SET_LEN(result, len); ary_verify(shared); - ary_verify(result); - return result; } + + ary_verify(result); + return result; } static VALUE