mirror of
https://github.com/alexkay/spek.git
synced 2025-04-19 01:47:37 +03:00
Simplify comparision in binary search
This commit is contained in:
parent
a4f35a625c
commit
f162976486
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user