MCPcopy Create free account
hub / github.com/IceFireDB/IceFireDB / Contain

Method Contain

IceFireDB-SQLProxy/pkg/mysql/mysql/mysql_gtid.go:111–131  ·  view source on GitHub ↗

Contain returns true if sub in s

(sub IntervalSlice)

Source from the content-addressed store, hash-verified

109
110// Contain returns true if sub in s
111func (s IntervalSlice) Contain(sub IntervalSlice) bool {
112 j := 0
113 for i := 0; i < len(sub); i++ {
114 for ; j < len(s); j++ {
115 if sub[i].Start > s[j].Stop {
116 continue
117 } else {
118 break
119 }
120 }
121 if j == len(s) {
122 return false
123 }
124
125 if sub[i].Start < s[j].Start || sub[i].Stop > s[j].Stop {
126 return false
127 }
128 }
129
130 return true
131}
132
133func (s IntervalSlice) Equal(o IntervalSlice) bool {
134 if len(s) != len(o) {

Callers 2

CompareMethod · 0.95

Calls

no outgoing calls

Tested by 1