vigna / fastutil

fastutil extends the Java™ Collections Framework by providing type-specific maps, sets, lists and queues.
Apache License 2.0
1.81k stars 199 forks source link

fastForEach does not support setValue though fastIterator does #288

Closed faucct closed 1 year ago

faucct commented 1 year ago

Is this intentional?

vigna commented 1 year ago

I didn't implement that part, so I cannot answer directly. But I think it wasn't intentional.

The problem is that fastIterator() uses an Entry() that remembers the position where it is located in the hash table, and thus can implement without problems setValue(). The forEach()/fastForEach()/etc. methods use a BasicEntry which has no such support.

I don't think it should be difficult to implement. I'll have a look at it.

vigna commented 1 year ago

Commit 4566dfe0ef5f4df77546a38094e4a3689df0fa1a should solve the problem. Please reopen this issue if it doesn't work for you.

faucct commented 1 year ago

Thanks!