From df556f0de2a26a24c6e4bae353854762d86b7afc Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 21 Jan 2014 17:56:22 +0100 Subject: m MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/algorithms/searching/MultibinarySearch.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/algorithms/searching') diff --git a/src/algorithms/searching/MultibinarySearch.java b/src/algorithms/searching/MultibinarySearch.java index 98ce3ff..2b473a1 100644 --- a/src/algorithms/searching/MultibinarySearch.java +++ b/src/algorithms/searching/MultibinarySearch.java @@ -197,11 +197,13 @@ public class MultibinarySearch lastimax = imax; lastamax = amax; rc[0][rc_i] = imax = imin + ((imax - imin) >>> 1); - rc[1][rc_i++] = amax = (int)(£{bin_search}); + amax = (int)(rc[1][rc_i++] = £{bin_search}); if (amax < 0) amax = ~amax; + /* This is possible to do, but you will probably lose performance: else if (mode == SearchMode.FIND_FIRST_AND_LAST) - amax >>= 32L; + amax = (int)(rc[1][rc_i - 1] >> 32L); + */ minomax[0][mm_i] = imax + 1; minomax[1][mm_i] = lastimax; -- cgit v1.2.3-70-g09d2