Open al8n opened 9 months ago
Hey @al8n sorry for the silence on my end. I looked at this the day you filed the issue but forgot to fill you in on what's going on. The issue is you're deleting things from the bucket that you're iterating over. The cursor remembers the index of the item you were on last, but when an item is deleted the indices for each key shift by one to the left. So on the next iteration of the loop the index increments by one, but that skips the element that you were expecting to be next.
You would run into a similar issue if you were to delete items from a vector in a for loop using an incrementing index.
This is definitely something that should be fixed, but no obvious solution is jumping out at me. I'm open to any ideas if you have some!
Hi folks, I found that
range
does not work expectedly.In the example,
range
only contains one element,key = 1, val = "1"
. But, I think the correctrange
should return two elementskey = 1
andkey = 2
.