<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -2224,8 +2224,8 @@ rb_ary_select(VALUE ary, SEL sel)
  *     a.delete(&quot;z&quot;) { &quot;not found&quot; }   #=&gt; &quot;not found&quot;
  */
 
-static VALUE
-rb_ary_delete_imp(VALUE ary, SEL sel, VALUE item)
+static inline bool
+rb_ary_delete0(VALUE ary, VALUE item)
 {
     rb_ary_modify(ary);
 
@@ -2252,6 +2252,14 @@ rb_ary_delete_imp(VALUE ary, SEL sel, VALUE item)
 	    changed = true;
 	}
     }
+
+    return changed;
+}
+
+static VALUE
+rb_ary_delete_imp(VALUE ary, SEL sel, VALUE item)
+{
+    const bool changed = rb_ary_delete0(ary, item);
     if (!changed) {
 	if (rb_block_given_p()) {
 	    return rb_yield(item);
@@ -2264,7 +2272,7 @@ rb_ary_delete_imp(VALUE ary, SEL sel, VALUE item)
 VALUE
 rb_ary_delete(VALUE ary, VALUE item)
 {
-    return rb_ary_delete_imp(ary, 0, item);
+    return rb_ary_delete0(ary, item) ? item : Qnil;
 }
 
 VALUE</diff>
      <filename>array.c</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>cc40fc554f14f4b25127e914be224292267bdf5d</id>
    </parent>
  </parents>
  <author>
    <name>lsansonetti@apple.com</name>
    <email>lsansonetti@apple.com@23306eb0-4c56-4727-a40e-e92c0eb68959</email>
  </author>
  <url>http://github.com/masterkain/macruby/commit/0bdf49280c3a935967529e6a37a06df821d7627d</url>
  <id>0bdf49280c3a935967529e6a37a06df821d7627d</id>
  <committed-date>2009-10-29T23:50:54-07:00</committed-date>
  <authored-date>2009-10-29T23:50:54-07:00</authored-date>
  <message>rb_ary_delete(): never yield current block

git-svn-id: http://svn.macosforge.org/repository/ruby/MacRuby/trunk@2928 23306eb0-4c56-4727-a40e-e92c0eb68959</message>
  <tree>ca9b9efb618bce6531b502b6f9b983bcd946ba77</tree>
  <committer>
    <name>lsansonetti@apple.com</name>
    <email>lsansonetti@apple.com@23306eb0-4c56-4727-a40e-e92c0eb68959</email>
  </committer>
</commit>
