Open sahib opened 11 months ago
I just realized the doc string for Iter()
says Iter() returns a read-only iterator
. I somehow missed that. Well, I guess this can be closed then.
Optionally you can copy the btree before iterating using the Copy function. This will allow for mutating the original btree while iterating over the copy.
Hello @tidwall,
thank you a lot for this very nice module, it was very handy to me several times.
I'm trying to debug a crash in one of my applications:
The respective program has roughly the following structure and is single-threaded (so we can rule out data races):
If I'm reading the code for map iteration right, then mutation during iteration does not seem to be supported as
Set()
does not seem to update the current iterators' stack. Is this correct and is this missing from the documentation? If yes, adding it would be great. I could do a PR if you want.