mirror of https://github.com/status-im/nim-eth.git
arc/orc lacks `shallowCopy` --> use `move` (#630)
`shallowCopy` is not available in `--mm:arc/orc`, but our usage can be replaced with `move`.
This commit is contained in:
parent
2ed8e991b5
commit
946ffe0a4a
|
@ -485,10 +485,16 @@ func len*(r: RoutingTable): int =
|
||||||
func moveRight[T](arr: var openArray[T], a, b: int) =
|
func moveRight[T](arr: var openArray[T], a, b: int) =
|
||||||
## In `arr` move elements in range [a, b] right by 1.
|
## In `arr` move elements in range [a, b] right by 1.
|
||||||
var t: T
|
var t: T
|
||||||
|
when declared(shallowCopy):
|
||||||
shallowCopy(t, arr[b + 1])
|
shallowCopy(t, arr[b + 1])
|
||||||
for i in countdown(b, a):
|
for i in countdown(b, a):
|
||||||
shallowCopy(arr[i + 1], arr[i])
|
shallowCopy(arr[i + 1], arr[i])
|
||||||
shallowCopy(arr[a], t)
|
shallowCopy(arr[a], t)
|
||||||
|
else:
|
||||||
|
t = move arr[b + 1]
|
||||||
|
for i in countdown(b, a):
|
||||||
|
arr[i + 1] = move arr[i]
|
||||||
|
arr[a] = move t
|
||||||
|
|
||||||
proc setJustSeen*(r: RoutingTable, n: Node) =
|
proc setJustSeen*(r: RoutingTable, n: Node) =
|
||||||
## Move `n` to the head (most recently seen) of its bucket.
|
## Move `n` to the head (most recently seen) of its bucket.
|
||||||
|
|
Loading…
Reference in New Issue