* Fix #14994 * Revert misplaced "optimization" * Typo
This commit is contained in:
parent
617c1f16d7
commit
282128ab66
3 changed files with 17 additions and 1 deletions
|
|
@ -82,6 +82,7 @@ proc shrink*[T](x: var seq[T]; newLen: Natural) =
|
|||
|
||||
proc grow*[T](x: var seq[T]; newLen: Natural; value: T) =
|
||||
let oldLen = x.len
|
||||
#sysAssert newLen >= x.len, "invalid newLen parameter for 'grow'"
|
||||
if newLen <= oldLen: return
|
||||
var xu = cast[ptr NimSeqV2[T]](addr x)
|
||||
if xu.p == nil or xu.p.cap < newLen:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue