eclipse-collections icon indicating copy to clipboard operation
eclipse-collections copied to clipboard

Optimize any/all/NoneSatisfy on UnifiedMapWithHashingStrategy

Open donraab opened this issue 3 years ago • 1 comments

The methods anySatisfy, allSatisfy and noneSatisfy should be optimized on UnifiedMapWithHashingStrategy similar to how they are optimized on UnifiedMap.

donraab avatar May 02 '22 04:05 donraab

Happy to take a look at this

Desislav-Petrov avatar Jul 18 '22 16:07 Desislav-Petrov

hi @donraab started looking at the issue - looks like we need implement the three methods on the UnifiedMapWithHashingStrategy with a similar implementation to the one in UnifiedMap. To avoid the duplication, we should probably extract the helper methods into a common util and reuse?

Desislav-Petrov avatar Oct 03 '22 17:10 Desislav-Petrov

The ultimate way to reduce code duplication would be to say our mutable maps are all new UnifiedMapWithHashingStrategy<>(HashingStrategies.defaultStrategy()) but we're worried this would hurt performance a bit. I wouldn't worry about duplication too much.

motlin avatar Oct 03 '22 20:10 motlin

Thanks @motlin - I was looking at it and it seemed nasty to just copy/paste the code so I decided to take it out in the util class and reuse.

Desislav-Petrov avatar Oct 04 '22 18:10 Desislav-Petrov