[macruby-changes] [5193] MacRuby/trunk/array.c

source_changes at macosforge.org source_changes at macosforge.org
Thu Jan 27 18:36:05 PST 2011


Revision: 5193
          http://trac.macosforge.org/projects/ruby/changeset/5193
Author:   lsansonetti at apple.com
Date:     2011-01-27 18:36:05 -0800 (Thu, 27 Jan 2011)
Log Message:
-----------
fix a bug in Array#delete where we would check if the receiver can be modified *after* modifying it

Modified Paths:
--------------
    MacRuby/trunk/array.c

Modified: MacRuby/trunk/array.c
===================================================================
--- MacRuby/trunk/array.c	2011-01-28 02:16:11 UTC (rev 5192)
+++ MacRuby/trunk/array.c	2011-01-28 02:36:05 UTC (rev 5193)
@@ -1842,6 +1842,7 @@
 VALUE
 rary_delete(VALUE ary, SEL sel, VALUE item)
 {
+    rary_modify(ary);
     const bool changed = rary_delete_element(ary, item, true);
     if (!changed) {
 	if (rb_block_given_p()) {
@@ -1849,8 +1850,6 @@
 	}
 	return Qnil;
     }
-
-    rary_modify(ary);
     return item;
 }
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20110127/93eed343/attachment.html>


More information about the macruby-changes mailing list