Contain returns true if sub in s
(sub IntervalSlice)
| 109 | |
| 110 | // Contain returns true if sub in s |
| 111 | func (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 | |
| 133 | func (s IntervalSlice) Equal(o IntervalSlice) bool { |
| 134 | if len(s) != len(o) { |
no outgoing calls