mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
update go-structr -> v0.8.2 which includes some minor memory usage improvements (#2904)
This commit is contained in:
6
vendor/codeberg.org/gruf/go-structr/queue.go
generated
vendored
6
vendor/codeberg.org/gruf/go-structr/queue.go
generated
vendored
@ -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
|
||||
|
Reference in New Issue
Block a user