Use new binarySearch everywhere (#7876)

This commit is contained in:
Dmitry Atamanov 2018-05-25 00:04:30 +03:00 • committed by GitHub
commit e206a8d952
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 68 deletions

View file

@ -520,20 +520,6 @@ proc isDynlibOverride*(conf: ConfigRef; lib: string): bool =
result = optDynlibOverrideAll in conf.globalOptions or
conf.dllOverrides.hasKey(lib.canonDynlibName)
proc binaryStrSearch*(x: openArray[string], y: string): int =
var a = 0
var b = len(x) - 1
while a <= b:
var mid = (a + b) div 2
var c = cmpIgnoreCase(x[mid], y)
if c < 0:
a = mid + 1
elif c > 0:
b = mid - 1
else:
return mid
result = - 1
proc parseIdeCmd*(s: string): IdeCmd =
case s:
of "sug": ideSug