added system.newSeqOfCap for improved efficiency
This commit is contained in:
parent
11b499f3ca
commit
b7c1be03c8
7 changed files with 47 additions and 4 deletions
|
|
@ -669,6 +669,12 @@ proc newSeq*[T](len = 0.Natural): seq[T] =
|
|||
## #inputStrings[3] = "out of bounds"
|
||||
newSeq(result, len)
|
||||
|
||||
proc newSeqOfCap*[T](cap: Natural): seq[T] {.
|
||||
magic: "NewSeqOfCap", noSideEffect.} =
|
||||
## creates a new sequence of type ``seq[T]`` with length 0 and capacity
|
||||
## ``cap``.
|
||||
discard
|
||||
|
||||
proc len*[TOpenArray: openArray|varargs](x: TOpenArray): int {.
|
||||
magic: "LengthOpenArray", noSideEffect.}
|
||||
proc len*(x: string): int {.magic: "LengthStr", noSideEffect.}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue