MCPcopy Create free account
hub / github.com/RoaringBitmap/roaring / intersectWithLeftover16

Function intersectWithLeftover16

runcontainer.go:1389–1417  ·  view source on GitHub ↗
(astart, alast, bstart, blast int)

Source from the content-addressed store, hash-verified

1387}
1388
1389func intersectWithLeftover16(astart, alast, bstart, blast int) (isOverlap, isLeftoverA, isLeftoverB bool, leftoverstart int, intersection interval16) {
1390 if !have4Overlap16(astart, alast, bstart, blast) {
1391 return
1392 }
1393 isOverlap = true
1394
1395 // do the intersection:
1396 if bstart > astart {
1397 intersection.start = uint16(bstart)
1398 } else {
1399 intersection.start = uint16(astart)
1400 }
1401
1402 switch {
1403 case blast < alast:
1404 isLeftoverA = true
1405 leftoverstart = blast + 1
1406 intersection.length = uint16(blast) - intersection.start
1407 case alast < blast:
1408 isLeftoverB = true
1409 leftoverstart = alast + 1
1410 intersection.length = uint16(alast) - intersection.start
1411 default:
1412 // alast == blast
1413 intersection.length = uint16(alast) - intersection.start
1414 }
1415
1416 return
1417}
1418
1419func (rc *runContainer16) findNextIntervalThatIntersectsStartingFrom(startIndex int, key int) (index int, done bool) {
1420 w, _, _ := rc.searchRange(key, startIndex, 0)

Callers 2

intersectMethod · 0.85
intersectCardinalityMethod · 0.85

Calls 1

have4Overlap16Function · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…