MCPcopy
hub / github.com/openimsdk/open-im-server / Add

Method Add

pkg/common/servererrs/relation.go:31–46  ·  view source on GitHub ↗
(codes ...int)

Source from the content-addressed store, hash-verified

29}
30
31func (r *relation) Add(codes ...int) {
32 if len(codes) < 2 {
33 panic("codes length must be greater than 2")
34 }
35 for i := 1; i < len(codes); i++ {
36 parent := codes[i-1]
37 s, ok := r.m[parent]
38 if !ok {
39 s = make(map[int]struct{})
40 r.m[parent] = s
41 }
42 for _, code := range codes[i:] {
43 s[code] = struct{}{}
44 }
45 }
46}
47
48func (r *relation) Is(parent, child int) bool {
49 if parent == child {

Callers 15

RunMethod · 0.80
MainFunction · 0.80
StartMethod · 0.80
distributeMessageMethod · 0.80
TestNameFunction · 0.80
GetMethod · 0.80
GetBatchMethod · 0.80
SetMethod · 0.80
SetHasMethod · 0.80
GetBatchMethod · 0.80
GetMethod · 0.80
SetHasMethod · 0.80

Calls

no outgoing calls

Tested by 6

TestNameFunction · 0.64
TestNameFunction · 0.64
TestSeqFunction · 0.64
TestOnlineFunction · 0.64
TestName4Function · 0.64