Skip to content

Commit e529cbd

Browse files
avoid pointer escape
1 parent 251b10c commit e529cbd

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

iter.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package roaring
22

33
func Values(b *Bitmap) func(func(uint32) bool) {
4-
it := b.Iterator()
54
return func(yield func(uint32) bool) {
5+
it := b.Iterator()
66
for it.HasNext() {
77
if !yield(it.Next()) {
88
return
@@ -12,8 +12,8 @@ func Values(b *Bitmap) func(func(uint32) bool) {
1212
}
1313

1414
func Backward(b *Bitmap) func(func(uint32) bool) {
15-
it := b.ReverseIterator()
1615
return func(yield func(uint32) bool) {
16+
it := b.ReverseIterator()
1717
for it.HasNext() {
1818
if !yield(it.Next()) {
1919
return

0 commit comments

Comments
 (0)