Skip to content

Commit

Permalink
Merge pull request #464 from dominiquelefevre/fewer-allocations-in-ia…
Browse files Browse the repository at this point in the history
…ndNotRunContainer16

runcontainer: make fewer memory allocations in iandNotRunContainer16().
  • Loading branch information
lemire authored Dec 24, 2024
2 parents 84c242d + cdb209e commit fc14622
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions runcontainer.go
Original file line number Diff line number Diff line change
Expand Up @@ -2464,12 +2464,8 @@ func (rc *runContainer16) toBitmapContainer() *bitmapContainer {
}

func (rc *runContainer16) iandNotRunContainer16(x2 *runContainer16) container {
rcb := rc.toBitmapContainer()
x2b := x2.toBitmapContainer()
rcb.iandNotBitmapSurely(x2b)
// TODO: check size and optimize the return value
// TODO: is inplace modification really required? If not, elide the copy.
rc2 := newRunContainer16FromBitmapContainer(rcb)
rc2 := rc.AndNotRunContainer16(x2)
*rc = *rc2
return rc
}
Expand Down

0 comments on commit fc14622

Please sign in to comment.