diff options
author | Dennis Felsing <dennis@felsin9.de> | 2016-08-23 12:26:38 +0200 |
---|---|---|
committer | Dennis Felsing <dennis@felsin9.de> | 2016-08-23 12:26:38 +0200 |
commit | 2ee88fef53b361efe15c12ca5e2c7c75fef23c69 (patch) | |
tree | 7fec587ec7e4e5482ee3aa5c7e72b533cc99af21 /lib | |
parent | 660e4e71237bb8260028ef1220855df841f2bf7e (diff) | |
download | Nim-2ee88fef53b361efe15c12ca5e2c7c75fef23c69.tar.gz |
Get rid of initialization warning
Diffstat (limited to 'lib')
-rw-r--r-- | lib/system.nim | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/system.nim b/lib/system.nim index 82980d9da..356248e6c 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -3232,7 +3232,7 @@ proc `[]`*[Idx, T](a: array[Idx, T], x: Slice[int]): seq[T] = when low(a) < 0: {.error: "Slicing for arrays with negative indices is unsupported.".} var L = x.b - x.a + 1 - newSeq(result, L) + result = newSeq[T](L) for i in 0.. <L: result[i] = a[i + x.a] proc `[]=`*[Idx, T](a: var array[Idx, T], x: Slice[int], b: openArray[T]) = @@ -3681,4 +3681,4 @@ when defined(nimconfig): when defined(windows) and appType == "console" and not defined(nimconfig): proc setConsoleOutputCP(codepage: cint): cint {.stdcall, dynlib: "kernel32", importc: "SetConsoleOutputCP".} - discard setConsoleOutputCP(65001) # 65001 - utf-8 codepage \ No newline at end of file + discard setConsoleOutputCP(65001) # 65001 - utf-8 codepage |