commit f162976486338d9804f668ce043d1defff6a2f3c parent a4f35a625c267ae630ec310c4811f902d2e89944 Author: Alexander Kojevnikov <alexander@kojevnikov.com> Date: Fri, 21 May 2010 09:08:12 +1000 Simplify comparision in binary search Diffstat:
M | src/spek-spectrogram.vala | | | 3 | +-- |
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/spek-spectrogram.vala b/src/spek-spectrogram.vala @@ -233,8 +233,7 @@ namespace Spek { while (k - i > 1) { var j = (i + k) / 2; cr.text_extents (end ? s[0:j] + fix : fix + s[j:s.length], out ext); - // TODO: replace with XOR when bgo#619177 is fixed. - if (end && ext.width <= length || !end && ext.width > length) { + if (end != (ext.width > length)) { i = j; } else { k = j;