summaryrefslogtreecommitdiff
path: root/range.c
diff options
context:
space:
mode:
authormarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-01-30 05:11:03 +0000
committermarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-01-30 05:11:03 +0000
commit39048aca7592a4096380f45f421bad578b61efb8 (patch)
tree43d9ac2aed6a5abd87a5cf28c40257e4dca016b2 /range.c
parentddea0c823239d2eb9b699dc00adf6b0963913d27 (diff)
* 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.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/range.c b/range.c
index 6bced0a..12436ce 100644
--- a/range.c
+++ b/range.c
@@ -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;