* Fix #14994

* Revert misplaced "optimization"

* Typo
This commit is contained in:
Clyybber 2020-07-15 23:33:58 +02:00 • committed by GitHub
commit 282128ab66
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 1 deletions

View file

@ -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: