From bfff8f7cee0c65c2f76164c8e75bbd267bc07cd0 Mon Sep 17 00:00:00 2001 From: bptato Date: Mon, 29 Jul 2024 20:34:14 +0200 Subject: twtstr: fix startsWithIgnoreCase --- src/utils/twtstr.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/utils/twtstr.nim') diff --git a/src/utils/twtstr.nim b/src/utils/twtstr.nim index 44c6ea3f..7cadd41f 100644 --- a/src/utils/twtstr.nim +++ b/src/utils/twtstr.nim @@ -108,9 +108,9 @@ func toHexLower*(u: uint16): string = func equalsIgnoreCase*(s1, s2: string): bool {.inline.} = return s1.cmpIgnoreCase(s2) == 0 -func startsWithIgnoreCase*(s1, s2: string; si = 0): bool = +func startsWithIgnoreCase*(s1, s2: openArray[char]): bool = if s1.len < s2.len: return false - for i in si ..< s2.len: + for i in 0 ..< s2.len: if s1[i].toLowerAscii() != s2[i].toLowerAscii(): return false return true -- cgit 1.4.1-2-gfad0