Skip to content

Commit a6af0ed

Browse files
amikaitrend-amikai-chuang
authored andcommitted
Avoid pointer escape
1 parent 251b10c commit a6af0ed

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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)