array.c: remove rb_ary_frozen_p / Array#frozen?
This is redundant since r15206 / ffe425ecaaa2a3f813e1d540e20e2179bce44302 as we no longer lock the array during sort. Instead, fall back to Object#frozen? git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62154 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
499658abff
commit
7fdb4099cd
16
array.c
16
array.c
@ -412,21 +412,6 @@ rb_ary_freeze(VALUE ary)
|
||||
return rb_obj_freeze(ary);
|
||||
}
|
||||
|
||||
/*
|
||||
* call-seq:
|
||||
* ary.frozen? -> true or false
|
||||
*
|
||||
* Return +true+ if this array is frozen (or temporarily frozen
|
||||
* while being sorted). See also Object#frozen?
|
||||
*/
|
||||
|
||||
static VALUE
|
||||
rb_ary_frozen_p(VALUE ary)
|
||||
{
|
||||
if (OBJ_FROZEN(ary)) return Qtrue;
|
||||
return Qfalse;
|
||||
}
|
||||
|
||||
/* This can be used to take a snapshot of an array (with
|
||||
e.g. rb_ary_replace) and check later whether the array has been
|
||||
modified from the snapshot. The snapshot is cheap, though if
|
||||
@ -6243,7 +6228,6 @@ Init_Array(void)
|
||||
rb_define_method(rb_cArray, "to_a", rb_ary_to_a, 0);
|
||||
rb_define_method(rb_cArray, "to_h", rb_ary_to_h, 0);
|
||||
rb_define_method(rb_cArray, "to_ary", rb_ary_to_ary_m, 0);
|
||||
rb_define_method(rb_cArray, "frozen?", rb_ary_frozen_p, 0);
|
||||
|
||||
rb_define_method(rb_cArray, "==", rb_ary_equal, 1);
|
||||
rb_define_method(rb_cArray, "eql?", rb_ary_eql, 1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user