fixes #6832
This commit is contained in:
parent
f31d1fa98b
commit
e4a76c6ebf
1 changed files with 2 additions and 5 deletions
|
|
@ -370,7 +370,7 @@ proc cmpIgnoreStyle*(a, b: string): int {.noSideEffect,
|
||||||
return 1
|
return 1
|
||||||
inc i
|
inc i
|
||||||
inc j
|
inc j
|
||||||
|
{.pop.}
|
||||||
|
|
||||||
# --------- Private templates for different split separators -----------
|
# --------- Private templates for different split separators -----------
|
||||||
|
|
||||||
|
|
@ -1474,7 +1474,7 @@ proc endsWith*(s, suffix: string): bool {.noSideEffect,
|
||||||
doAssert a.endsWith("dab") == false
|
doAssert a.endsWith("dab") == false
|
||||||
var i = 0
|
var i = 0
|
||||||
var j = len(s) - len(suffix)
|
var j = len(s) - len(suffix)
|
||||||
while i+j <% s.len:
|
while i+j >= 0 and i+j < s.len:
|
||||||
if s[i+j] != suffix[i]: return false
|
if s[i+j] != suffix[i]: return false
|
||||||
inc(i)
|
inc(i)
|
||||||
if i >= suffix.len: return true
|
if i >= suffix.len: return true
|
||||||
|
|
@ -2636,9 +2636,6 @@ proc format*(formatstr: string, a: varargs[string, `$`]): string {.noSideEffect,
|
||||||
result = newStringOfCap(formatstr.len + a.len)
|
result = newStringOfCap(formatstr.len + a.len)
|
||||||
addf(result, formatstr, a)
|
addf(result, formatstr, a)
|
||||||
|
|
||||||
{.pop.}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
proc strip*(s: string, leading = true, trailing = true,
|
proc strip*(s: string, leading = true, trailing = true,
|
||||||
chars: set[char] = Whitespace): string
|
chars: set[char] = Whitespace): string
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue