Optimize Range#bsearch for beginless/endless ranges
On Range#bsearch for endless ranges, we try positions at begin + 2**i (i = 0, 1, 2, ...)
to find a point that satisfies a given condition.
Subsequently, we perform binary searching with the interval [begin, begin + 2**n].
However, the interval [begin + 2**(n-1), begin + 2**n] is sufficient for binary search
because begin + 2**(n-1) does not satisfy the condition.
Optimize Range#bsearch for beginless/endless ranges
On Range#bsearch for endless ranges, we try positions at
begin + 2**i
(i = 0, 1, 2, ...)to find a point that satisfies a given condition.
Subsequently, we perform binary searching with the interval
[begin, begin + 2**n]
.However, the interval
[begin + 2**(n-1), begin + 2**n]
is sufficient for binary searchbecause
begin + 2**(n-1)
does not satisfy the condition.The same applies to beginless ranges.