diff options
author | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-01-30 05:11:03 +0000 |
---|---|---|
committer | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-01-30 05:11:03 +0000 |
commit | 39048aca7592a4096380f45f421bad578b61efb8 (patch) | |
tree | 43d9ac2aed6a5abd87a5cf28c40257e4dca016b2 /range.c | |
parent | ddea0c823239d2eb9b699dc00adf6b0963913d27 (diff) | |
download | ruby-39048aca7592a4096380f45f421bad578b61efb8.tar.gz |
* array.c (rb_ary_bsearch): Return enumerator if no block [#7725]
* range.c (range_bsearch): ditto
* test/ruby/test_array.rb: Test for above
* test/ruby/test_range.rb: ditto
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'range.c')
-rw-r--r-- | range.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -595,6 +595,7 @@ range_bsearch(VALUE range) #define BSEARCH(conv) \ do { \ + RETURN_ENUMERATOR(range, 0, 0); \ if (EXCL(range)) high--; \ org_high = high; \ while (low < high) { \ @@ -639,6 +640,7 @@ range_bsearch(VALUE range) VALUE low = beg; VALUE high = end; VALUE mid, org_high; + RETURN_ENUMERATOR(range, 0, 0); if (EXCL(range)) high = rb_funcall(high, '-', 1, INT2FIX(1)); org_high = high; |