aboutsummaryrefslogtreecommitdiffstats
path: root/array.c
diff options
context:
space:
mode:
authorduerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-09-27 07:47:13 +0000
committerduerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-09-27 07:47:13 +0000
commit0d21c43baf317ef6e0ee59e400da01c1a81df42a (patch)
treeb2cc815a993cb2af939634bd89177e04761fbab4 /array.c
parent623ba3921b854a0fc1dfefe81bd44bee11a29540 (diff)
downloadruby-0d21c43baf317ef6e0ee59e400da01c1a81df42a.tar.gz
improve grammar in documentation of Array#bsearch [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60045 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r--array.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/array.c b/array.c
index 9faaa88673..27126cefbc 100644
--- a/array.c
+++ b/array.c
@@ -2561,12 +2561,12 @@ static VALUE rb_ary_bsearch_index(VALUE ary);
* By using binary search, finds a value from this array which meets
* the given condition in O(log n) where n is the size of the array.
*
- * You can use this method in two use cases: a find-minimum mode and
+ * You can use this method in two modes: a find-minimum mode and
* a find-any mode. In either case, the elements of the array must be
* monotone (or sorted) with respect to the block.
*
- * In find-minimum mode (this is a good choice for typical use case),
- * the block must return true or false, and there must be an index i
+ * In find-minimum mode (this is a good choice for typical use cases),
+ * the block must always return true or false, and there must be an index i
* (0 <= i <= ary.size) so that:
*
* - the block returns false for any element whose index is less than
@@ -2584,7 +2584,7 @@ static VALUE rb_ary_bsearch_index(VALUE ary);
* ary.bsearch {|x| x >= 100 } #=> nil
*
* In find-any mode (this behaves like libc's bsearch(3)), the block
- * must return a number, and there must be two indices i and j
+ * must always return a number, and there must be two indices i and j
* (0 <= i <= j <= ary.size) so that:
*
* - the block returns a positive number for ary[k] if 0 <= k < i,
@@ -2625,8 +2625,8 @@ rb_ary_bsearch(VALUE ary)
* By using binary search, finds an index of a value from this array which
* meets the given condition in O(log n) where n is the size of the array.
*
- * It supports two modes, depending on the nature of the block and they are
- * exactly the same as in the case of #bsearch method with the only difference
+ * It supports two modes, depending on the nature of the block. They are
+ * exactly the same as in the case of the #bsearch method, with the only difference
* being that this method returns the index of the element instead of the
* element itself. For more details consult the documentation for #bsearch.
*/