mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
update go-structr to v0.8.11 (#3380)
This commit is contained in:
16
vendor/codeberg.org/gruf/go-structr/queue.go
generated
vendored
16
vendor/codeberg.org/gruf/go-structr/queue.go
generated
vendored
@ -68,9 +68,9 @@ func (q *Queue[T]) Init(config QueueConfig[T]) {
|
||||
|
||||
// Index selects index with given name from queue, else panics.
|
||||
func (q *Queue[T]) Index(name string) *Index {
|
||||
for i := range q.indices {
|
||||
if q.indices[i].name == name {
|
||||
return &q.indices[i]
|
||||
for i, idx := range q.indices {
|
||||
if idx.name == name {
|
||||
return &(q.indices[i])
|
||||
}
|
||||
}
|
||||
panic("unknown index: " + name)
|
||||
@ -207,17 +207,17 @@ func (q *Queue[T]) Len() int {
|
||||
|
||||
// Debug returns debug stats about queue.
|
||||
func (q *Queue[T]) Debug() map[string]any {
|
||||
m := make(map[string]any)
|
||||
m := make(map[string]any, 2)
|
||||
q.mutex.Lock()
|
||||
m["queue"] = q.queue.len
|
||||
indices := make(map[string]any)
|
||||
indices := make(map[string]any, len(q.indices))
|
||||
m["indices"] = indices
|
||||
for i := range q.indices {
|
||||
for _, idx := range q.indices {
|
||||
var n uint64
|
||||
for _, l := range q.indices[i].data.m {
|
||||
for _, l := range idx.data.m {
|
||||
n += uint64(l.len)
|
||||
}
|
||||
indices[q.indices[i].name] = n
|
||||
indices[idx.name] = n
|
||||
}
|
||||
q.mutex.Unlock()
|
||||
return m
|
||||
|
Reference in New Issue
Block a user