Skip to content

Commit

Permalink
replace shallowCopy with move
Browse files Browse the repository at this point in the history
  • Loading branch information
ringabout authored and jangko committed Aug 30, 2022
1 parent 71e5dd8 commit ac14183
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions noise.nim
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,10 @@ when promptPreloadBuffer:
truncated = true
temp.setLen(PROMPT_MAX_LINE - 1)

shallowCopy(self.preloadText, temp)
self.preloadText = move temp
if truncated:
self.preloadError.add " [Edited line: the line length was reduced from "
self.preloadError.add "$1 to $1\n" % [$temp.len, $(PROMPT_MAX_LINE - 1)]
self.preloadError.add "$1 to $1\n" % [$self.preloadText.len, $(PROMPT_MAX_LINE - 1)]

when promptKill:
proc killSetMaxLen*(self: var Noise, len: int) =
Expand Down

0 comments on commit ac14183

Please sign in to comment.