Closed liptga closed 2 years ago
Hmm, that code I merged from a contributor, but honestly I find it quite hard right now to figure out what it does and why it does it in a certain way. I'll look into it.
I also tried to debug it, but I did not know the code, and a workaround if I stop by the first "already known" element worked well. So I just used my workaround. But definitely it would be interesting to understand why this happens.
I could internalize the Set
of already produced hashes into the iterator and then stop producing new values as soon as it loops, but I'd rather understand why it loops. :)
Yeah, I know. I had to go to the next bug in our software, so there was no time anymore for that. But it was funny, since we collected the hashes in a collection and then we have got GC limit overhead OOM in production :)
Please see the following test class:
I would expect, that each hash comes only once, and the iterator exits. Output: