canMerge returns true iff the intervals a and b either overlap or they are contiguous and so can be merged into a single interval.
(a, b interval16)
| 299 | // contiguous and so can be merged into |
| 300 | // a single interval. |
| 301 | func canMerge16(a, b interval16) bool { |
| 302 | if int(a.last())+1 < int(b.start) { |
| 303 | return false |
| 304 | } |
| 305 | return int(b.last())+1 >= int(a.start) |
| 306 | } |
| 307 | |
| 308 | // haveOverlap differs from canMerge in that |
| 309 | // it tells you if the intersection of a |
searching dependent graphs…