1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

bf: fix resize()

This commit is contained in:
Alexander Medvednikov 2019-09-08 16:10:59 +03:00
parent dcc42c858b
commit 6dcdb224a1

View File

@ -486,7 +486,7 @@ pub fn (instance mut BitField) resize(size int) {
for i := 0; i < old_bitnslots && i < new_bitnslots; i++ { for i := 0; i < old_bitnslots && i < new_bitnslots; i++ {
field[i] = instance.field[i] field[i] = instance.field[i]
} }
instance.field = field instance.field = field.clone()
instance.size = size instance.size = size
if size < old_size && size % SLOT_SIZE != 0 { if size < old_size && size % SLOT_SIZE != 0 {
cleartail(mut instance) cleartail(mut instance)