fixes #21278; deques.shrink off by one bug (#21284)

fixes #21278; deques.shrink off ny one bug
This commit is contained in:
ringabout 2023-01-20 18:43:45 +08:00 • committed by GitHub
commit b82b5d44af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View file

@ -183,6 +183,12 @@ proc main() =
clear(a)
doAssert len(a) == 0
block: # bug #21278
var a = [10, 20, 30, 40].toDeque
a.shrink(fromFirst = 0, fromLast = 1)
doAssert $a == "[10, 20, 30]"
static: main()
main()