mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 15:52:26 -05:00
update go-structr -> v0.8.2 which includes some minor memory usage improvements (#2904)
This commit is contained in:
parent
45f4afe60e
commit
3554991444
6 changed files with 29 additions and 5 deletions
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue