[前][次][番号順一覧][スレッド一覧]

ruby-changes:50036

From: normal <ko1@a...>
Date: Thu, 1 Feb 2018 18:20:44 +0900 (JST)
Subject: [ruby-changes:50036] normal:r62154 (trunk): array.c: remove rb_ary_frozen_p / Array#frozen?

normal	2018-02-01 18:20:38 +0900 (Thu, 01 Feb 2018)

  New Revision: 62154

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62154

  Log:
    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?

  Modified files:
    trunk/array.c
Index: array.c
===================================================================
--- array.c	(revision 62153)
+++ array.c	(revision 62154)
@@ -412,21 +412,6 @@ rb_ary_freeze(VALUE ary) https://github.com/ruby/ruby/blob/trunk/array.c#L412
     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) https://github.com/ruby/ruby/blob/trunk/array.c#L6228
     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);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]