(pos)
| 66 | } |
| 67 | |
| 68 | reduce(pos) { |
| 69 | // only need to reduce if pos is not the last |
| 70 | if (pos < this.intervals.length - 1) { |
| 71 | const current = this.intervals[pos]; |
| 72 | const next = this.intervals[pos + 1]; |
| 73 | // if next contained in current |
| 74 | if (current.stop >= next.stop) { |
| 75 | this.intervals.splice(pos + 1, 1); |
| 76 | this.reduce(pos); |
| 77 | } else if (current.stop >= next.start) { |
| 78 | this.intervals[pos] = new Interval(current.start, next.stop); |
| 79 | this.intervals.splice(pos + 1, 1); |
| 80 | } |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | complement(start, stop) { |
| 85 | const result = new IntervalSet(); |
no outgoing calls
no test coverage detected