MCPcopy Index your code
hub / github.com/dataease/SQLBot / intersect

Method intersect

frontend/public/swagger-ui-bundle.js:26685–26703  ·  view source on GitHub ↗
(s, o)

Source from the content-addressed store, hash-verified

26683 )
26684 }
26685 intersect(s, o) {
26686 var i = [],
26687 _intersect = (s) => {
26688 for (var o = 0; o < this.ranges.length && !s.overlaps(this.ranges[o]); ) o++
26689 for (; o < this.ranges.length && s.overlaps(this.ranges[o]); ) {
26690 var a = Math.max(this.ranges[o].low, s.low),
26691 u = Math.min(this.ranges[o].high, s.high)
26692 ;(i.push(new SubRange(a, u)), o++)
26693 }
26694 }
26695 return (
26696 s instanceof DRange
26697 ? s.ranges.forEach(_intersect)
26698 : (null == o && (o = s), _intersect(new SubRange(s, o))),
26699 (this.ranges = i),
26700 this._update_length(),
26701 this
26702 )
26703 }
26704 index(s) {
26705 for (var o = 0; o < this.ranges.length && this.ranges[o].length <= s; )
26706 ((s -= this.ranges[o].length), o++)

Callers 1

_expandMethod · 0.80

Calls 2

_update_lengthMethod · 0.95
forEachMethod · 0.45

Tested by

no test coverage detected