make tests green again
This commit is contained in:
parent
ddaf2e3805
commit
f12a5431a1
3 changed files with 3 additions and 5 deletions
|
|
@ -4112,6 +4112,7 @@ template once*(body: untyped): untyped =
|
|||
{.pop.} #{.push warning[GcMem]: off, warning[Uninit]: off.}
|
||||
|
||||
proc substr*(s: string, first, last: int): string =
|
||||
let first = max(first, 0)
|
||||
let L = max(min(last, high(s)) - first + 1, 0)
|
||||
result = newString(L)
|
||||
for i in 0 .. L-1:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue