bugfix: system.& for sequences
This commit is contained in:
parent
698eac2a94
commit
fca23d1675
1 changed files with 2 additions and 2 deletions
|
|
@ -1454,9 +1454,9 @@ proc `&` *[T](x: seq[T], y: T): seq[T] {.noSideEffect.} =
|
||||||
|
|
||||||
proc `&` *[T](x: T, y: seq[T]): seq[T] {.noSideEffect.} =
|
proc `&` *[T](x: T, y: seq[T]): seq[T] {.noSideEffect.} =
|
||||||
newSeq(result, y.len + 1)
|
newSeq(result, y.len + 1)
|
||||||
|
result[0] = x
|
||||||
for i in 0..y.len-1:
|
for i in 0..y.len-1:
|
||||||
result[i] = y[i]
|
result[i+1] = y[i]
|
||||||
result[y.len] = x
|
|
||||||
|
|
||||||
when not defined(NimrodVM):
|
when not defined(NimrodVM):
|
||||||
when not defined(JS):
|
when not defined(JS):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue