Skip to content

Commit

Permalink
cleanup 3
Browse files Browse the repository at this point in the history
  • Loading branch information
aliszka committed Nov 5, 2024
1 parent 4093129 commit f2f7fb3
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions bitmap_opt.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ func And(a, b *Bitmap) *Bitmap {
return res
}

andContainersStandalone(a, b, res, nil)
andContainers(a, b, res, nil)
return res
}

Expand All @@ -22,11 +22,11 @@ func AndBuf(a, b *Bitmap, buf []uint16) *Bitmap {
return res
}

andContainersStandalone(a, b, res, buf)
andContainers(a, b, res, buf)
return res
}

func andContainersStandalone(a, b, res *Bitmap, optBuf []uint16) {
func andContainers(a, b, res *Bitmap, optBuf []uint16) {
ai, an := 0, a.keys.numKeys()
bi, bn := 0, b.keys.numKeys()

Expand Down Expand Up @@ -60,7 +60,7 @@ func (ra *Bitmap) And(bm *Bitmap) *Bitmap {
return ra
}

andContainersInRangeAlt(ra, bm, 0, ra.keys.numKeys(), nil)
andContainersInRange(ra, bm, 0, ra.keys.numKeys(), nil)
return ra
}

Expand All @@ -72,11 +72,11 @@ func (ra *Bitmap) AndBuf(bm *Bitmap, buf []uint16) *Bitmap {
return ra
}

andContainersInRangeAlt(ra, bm, 0, ra.keys.numKeys(), buf)
andContainersInRange(ra, bm, 0, ra.keys.numKeys(), buf)
return ra
}

func andContainersInRangeAlt(a, b *Bitmap, ai, an int, optBuf []uint16) {
func andContainersInRange(a, b *Bitmap, ai, an int, optBuf []uint16) {
ak := a.keys.key(ai)
bi := b.keys.search(ak)
bn := b.keys.numKeys()
Expand Down Expand Up @@ -121,7 +121,7 @@ func AndNot(a, b *Bitmap) *Bitmap {
return a.Clone()
}

andNotContainersStandalone(a, b, res, nil)
andNotContainers(a, b, res, nil)
return res
}

Expand All @@ -136,11 +136,11 @@ func AndNotBuf(a, b *Bitmap, buf []uint16) *Bitmap {
return a.Clone()
}

andNotContainersStandalone(a, b, res, buf)
andNotContainers(a, b, res, buf)
return res
}

func andNotContainersStandalone(a, b, res *Bitmap, optBuf []uint16) {
func andNotContainers(a, b, res *Bitmap, optBuf []uint16) {
ai, an := 0, a.keys.numKeys()
bi, bn := 0, b.keys.numKeys()

Expand Down Expand Up @@ -192,7 +192,7 @@ func (ra *Bitmap) AndNot(bm *Bitmap) *Bitmap {
return ra
}

andNotContainersInRangeAlt(ra, bm, 0, bm.keys.numKeys(), nil)
andNotContainersInRange(ra, bm, 0, bm.keys.numKeys(), nil)
return ra
}

Expand All @@ -203,11 +203,11 @@ func (ra *Bitmap) AndNotBuf(bm *Bitmap, buf []uint16) *Bitmap {
return ra
}

andNotContainersInRangeAlt(ra, bm, 0, bm.keys.numKeys(), buf)
andNotContainersInRange(ra, bm, 0, bm.keys.numKeys(), buf)
return ra
}

func andNotContainersInRangeAlt(a, b *Bitmap, bi, bn int, optBuf []uint16) {
func andNotContainersInRange(a, b *Bitmap, bi, bn int, optBuf []uint16) {
bk := b.keys.key(bi)
ai := a.keys.search(bk)
an := a.keys.numKeys()
Expand Down Expand Up @@ -246,7 +246,7 @@ func Or(a, b *Bitmap) *Bitmap {
}

buf := make([]uint16, maxContainerSize)
orContainersStandalone(a, b, res, buf)
orContainers(a, b, res, buf)
return res
}

Expand All @@ -262,11 +262,11 @@ func OrBuf(a, b *Bitmap, buf []uint16) *Bitmap {
return a.Clone()
}

orContainersStandalone(a, b, res, buf)
orContainers(a, b, res, buf)
return res
}

func orContainersStandalone(a, b, res *Bitmap, buf []uint16) {
func orContainers(a, b, res *Bitmap, buf []uint16) {
ai, an := 0, a.keys.numKeys()
bi, bn := 0, b.keys.numKeys()

Expand Down Expand Up @@ -338,7 +338,7 @@ func (ra *Bitmap) Or(bm *Bitmap) *Bitmap {
}

buf := make([]uint16, maxContainerSize)
orContainersInRangeAlt(ra, bm, 0, bm.keys.numKeys(), buf)
orContainersInRange(ra, bm, 0, bm.keys.numKeys(), buf)
return ra
}

Expand All @@ -349,11 +349,11 @@ func (ra *Bitmap) OrBuf(bm *Bitmap, buf []uint16) *Bitmap {
return ra
}

orContainersInRangeAlt(ra, bm, 0, bm.keys.numKeys(), buf)
orContainersInRange(ra, bm, 0, bm.keys.numKeys(), buf)
return ra
}

func orContainersInRangeAlt(a, b *Bitmap, bi, bn int, buf []uint16) {
func orContainersInRange(a, b *Bitmap, bi, bn int, buf []uint16) {
bk := b.keys.key(bi)
ai := a.keys.search(bk)
an := a.keys.numKeys()
Expand Down

0 comments on commit f2f7fb3

Please sign in to comment.