array.c.patch

fix delete_if - Yura Sokolov, 12/14/2011 07:03 PM

Download (719 Bytes)

View differences:

array.c
2615 2615
static VALUE
2616 2616
rb_ary_reject_bang(VALUE ary)
2617 2617
{
2618
    VALUE rejected_ary, result;
2619
    int state = 0;
2620

  
2618 2621
    RETURN_ENUMERATOR(ary, 0, 0);
2619
    return ary_reject_bang(ary);
2622
    rejected_ary = rb_ary_dup(ary);
2623
    result = rb_protect(ary_reject_bang, rejected_ary, &state);
2624
    rb_ary_replace(ary, rejected_ary);
2625
    if (state) rb_jump_tag(state);
2626
    return RTEST(result) ? ary : Qnil;
2620 2627
}
2621 2628

  
2622 2629
/*
......
2662 2669
rb_ary_delete_if(VALUE ary)
2663 2670
{
2664 2671
    RETURN_ENUMERATOR(ary, 0, 0);
2665
    ary_reject_bang(ary);
2672
    rb_ary_reject_bang(ary);
2666 2673
    return ary;
2667 2674
}
2668 2675