Skip to content

Commit

Permalink
replace shallowCopy with move (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
ringabout authored Jul 24, 2022
1 parent b955b2d commit 839286c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cligen/sysUt.nim
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ proc findUO*(s: string, c: char): int {.noSideEffect.} =
proc delete*(x: var string, i: Natural) {.noSideEffect.} =
## Just like ``delete(var seq[T], i)`` but for ``string``.
let xl = x.len
for j in i.int .. xl-2: shallowCopy(x[j], x[j+1])
for j in i.int .. xl-2:
x[j] = move x[j+1]
setLen(x, xl-1)

iterator maybePar*(parallel: bool, a, b: int): int =
Expand Down

0 comments on commit 839286c

Please sign in to comment.