mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-15 05:43:02 -06:00
update go-structr to v0.8.11 (#3380)
This commit is contained in:
parent
e3019eada4
commit
c17abea921
11 changed files with 306 additions and 91 deletions
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue