Debian Codegraph @

relatableq.go

raw symbols SCIP
1 package irelatescip-go gomod github.com/brentp/irelate . `github.com/brentp/irelate`/
2
3 import "github.com/brentp/irelate/interfacesscip-go gomod github.com/brentp/irelate . `github.com/brentp/irelate/interfaces`/"
4
5 // relatableQueue implements the heap interface and is used to send Relatables
6 // back the the caller in order (as deteremined by Less()).
7 type relatableQueuescip-go gomod github.com/brentp/irelate . `github.com/brentp/irelate`/relatableQueue# struct {
8 relsscip-go gomod github.com/brentp/irelate . `github.com/brentp/irelate`/relatableQueue#rels. []interfacesscip-go gomod github.com/brentp/irelate . `github.com/brentp/irelate/interfaces`/.Relatablescip-go gomod github.com/brentp/irelate . `github.com/brentp/irelate/interfaces`/Relatable#
9 lessscip-go gomod github.com/brentp/irelate . `github.com/brentp/irelate`/relatableQueue#less. func(a, b interfacesscip-go gomod github.com/brentp/irelate . `github.com/brentp/irelate/interfaces`/.Relatablescip-go gomod github.com/brentp/irelate . `github.com/brentp/irelate/interfaces`/Relatable#) bool
10 }
11
12 func (q relatableQueuescip-go gomod github.com/brentp/irelate . `github.com/brentp/irelate`/relatableQueue#) Lenscip-go gomod github.com/brentp/irelate . `github.com/brentp/irelate`/relatableQueue#Len().() int { return len(q.relsscip-go gomod github.com/brentp/irelate . `github.com/brentp/irelate`/relatableQueue#rels.) }
13 func (q relatableQueuescip-go gomod github.com/brentp/irelate . `github.com/brentp/irelate`/relatableQueue#) Lessscip-go gomod github.com/brentp/irelate . `github.com/brentp/irelate`/relatableQueue#Less().(i, j int) bool {
14 return q.lessscip-go gomod github.com/brentp/irelate . `github.com/brentp/irelate`/relatableQueue#less.(q.relsscip-go gomod github.com/brentp/irelate . `github.com/brentp/irelate`/relatableQueue#rels.[i], q.relsscip-go gomod github.com/brentp/irelate . `github.com/brentp/irelate`/relatableQueue#rels.[j])
15 }
16 func (q relatableQueuescip-go gomod github.com/brentp/irelate . `github.com/brentp/irelate`/relatableQueue#) Swapscip-go gomod github.com/brentp/irelate . `github.com/brentp/irelate`/relatableQueue#Swap().(i, j int) {
17 if i < len(q.relsscip-go gomod github.com/brentp/irelate . `github.com/brentp/irelate`/relatableQueue#rels.) {
18 q.relsscip-go gomod github.com/brentp/irelate . `github.com/brentp/irelate`/relatableQueue#rels.[j], q.relsscip-go gomod github.com/brentp/irelate . `github.com/brentp/irelate`/relatableQueue#rels.[i] = q.relsscip-go gomod github.com/brentp/irelate . `github.com/brentp/irelate`/relatableQueue#rels.[i], q.relsscip-go gomod github.com/brentp/irelate . `github.com/brentp/irelate`/relatableQueue#rels.[j]
19 }
20 }
21 func (q *relatableQueuescip-go gomod github.com/brentp/irelate . `github.com/brentp/irelate`/relatableQueue#) Pushscip-go gomod github.com/brentp/irelate . `github.com/brentp/irelate`/relatableQueue#Push().(i interface{}) {
22 iv := i.(interfacesscip-go gomod github.com/brentp/irelate . `github.com/brentp/irelate/interfaces`/.Relatablescip-go gomod github.com/brentp/irelate . `github.com/brentp/irelate/interfaces`/Relatable#)
23 (*q).relsscip-go gomod github.com/brentp/irelate . `github.com/brentp/irelate`/relatableQueue#rels. = append((*q).relsscip-go gomod github.com/brentp/irelate . `github.com/brentp/irelate`/relatableQueue#rels., iv)
24 }
25
26 func (q *relatableQueuescip-go gomod github.com/brentp/irelate . `github.com/brentp/irelate`/relatableQueue#) Popscip-go gomod github.com/brentp/irelate . `github.com/brentp/irelate`/relatableQueue#Pop().() interface{} {
27 n := len((*q).relsscip-go gomod github.com/brentp/irelate . `github.com/brentp/irelate`/relatableQueue#rels.)
28 if n == 0 {
29 return nil
30 }
31 old := (*q).relsscip-go gomod github.com/brentp/irelate . `github.com/brentp/irelate`/relatableQueue#rels.
32 iv := old[n-1]
33 (*q).relsscip-go gomod github.com/brentp/irelate . `github.com/brentp/irelate`/relatableQueue#rels. = old[0 : n-1]
34 return iv
35 }