update go-structr -> v0.8.2 which includes some minor memory usage improvements (#2904)

This commit is contained in:
kim 2024-05-06 19:44:22 +00:00 committed by GitHub
commit 3554991444
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 29 additions and 5 deletions

View file

@ -276,6 +276,12 @@ func (q *Queue[T]) pop_n(n int, next func() *list_elem) []T {
func (q *Queue[T]) index(value T) *indexed_item {
item := new_indexed_item()
if cap(item.indexed) < len(q.indices) {
// Preallocate item indices slice to prevent Go auto
// allocating overlying large slices we don't need.
item.indexed = make([]*index_entry, 0, len(q.indices))
}
// Set item value.
item.data = value