diff options
author | Amjad Ben Hedhili <amjadhedhili@outlook.com> | 2023-08-17 05:38:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-17 06:38:15 +0200 |
commit | 299394d21a3b7f2af02c8cdede1dcd0cd5948a0e (patch) | |
tree | 1db714836d332f37a28155a120eb4987a2b7ef67 /lib/system/seqs_v2.nim | |
parent | 940b1607b8459b4b7b7e20d316bec95c8de85809 (diff) | |
download | Nim-299394d21a3b7f2af02c8cdede1dcd0cd5948a0e.tar.gz |
Fix `seq.capacity` (#22488)
Diffstat (limited to 'lib/system/seqs_v2.nim')
-rw-r--r-- | lib/system/seqs_v2.nim | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/system/seqs_v2.nim b/lib/system/seqs_v2.nim index efc2919fd..3a49142bf 100644 --- a/lib/system/seqs_v2.nim +++ b/lib/system/seqs_v2.nim @@ -141,7 +141,7 @@ proc newSeq[T](s: var seq[T], len: Natural) = template capacityImpl(sek: NimSeqV2): int = - if sek.p != nil: (xu.p.cap and not strlitFlag) else: 0 + if sek.p != nil: (sek.p.cap and not strlitFlag) else: 0 func capacity*[T](self: seq[T]): int {.inline.} = ## Returns the current capacity of the seq. @@ -153,7 +153,7 @@ func capacity*[T](self: seq[T]): int {.inline.} = {.cast(noSideEffect).}: let sek = unsafeAddr self - result = capacityImpl(cast[ptr NimSeqV2](sek)[]) + result = capacityImpl(cast[ptr NimSeqV2[T]](sek)[]) {.pop.} # See https://github.com/nim-lang/Nim/issues/21401 |