File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -5321,8 +5321,8 @@ rb_ary_eql(VALUE ary1, VALUE ary2)
53215321 return rb_exec_recursive_paired (recursive_eql , ary1 , ary2 , ary2 );
53225322}
53235323
5324- VALUE
5325- rb_ary_hash_values (long len , const VALUE * elements )
5324+ static VALUE
5325+ ary_hash_values (long len , const VALUE * elements , const VALUE ary )
53265326{
53275327 long i ;
53285328 st_index_t h ;
@@ -5333,11 +5333,21 @@ rb_ary_hash_values(long len, const VALUE *elements)
53335333 for (i = 0 ; i < len ; i ++ ) {
53345334 n = rb_hash (elements [i ]);
53355335 h = rb_hash_uint (h , NUM2LONG (n ));
5336+ if (ary ) {
5337+ len = RARRAY_LEN (ary );
5338+ elements = RARRAY_CONST_PTR (ary );
5339+ }
53365340 }
53375341 h = rb_hash_end (h );
53385342 return ST2FIX (h );
53395343}
53405344
5345+ VALUE
5346+ rb_ary_hash_values (long len , const VALUE * elements )
5347+ {
5348+ return ary_hash_values (len , elements , 0 );
5349+ }
5350+
53415351/*
53425352 * call-seq:
53435353 * hash -> integer
@@ -5356,7 +5366,8 @@ rb_ary_hash_values(long len, const VALUE *elements)
53565366static VALUE
53575367rb_ary_hash (VALUE ary )
53585368{
5359- return rb_ary_hash_values (RARRAY_LEN (ary ), RARRAY_CONST_PTR (ary ));
5369+ RBIMPL_ASSERT_OR_ASSUME (ary );
5370+ return ary_hash_values (RARRAY_LEN (ary ), RARRAY_CONST_PTR (ary ), ary );
53605371}
53615372
53625373/*
You can’t perform that action at this time.
0 commit comments