|
|
|
|
|
by hknmtt
1325 days ago
|
|
i don't see any issue here. same behavior can be achieved with slices:
foo := make([]int, 0, 1000)
for {
for k := range bar {
foo = append(foo, k)
}
foo = foo[:0]
} the slice will grow as much as the largest dataset. map will be the same. you need to let go of it to be GCd and create a new one. |
|
[1] I would argue a general purpose hash table/map should really switch to using a hash code=>index mapping automatically if the value type size is sufficiently large.