vigna / fastutil

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

Implement type-specific merge() for maps #207

Closed vigna closed 3 years ago

vigna commented 3 years ago

There is now enough infrastructure to implement Map.merge() using primitive functions. There could be three versions, similarly to computeIfAbsent(): one using the closest JDK match, one using a map returning objects (nullable), and one using fastutil functions and exploiting containsKey(). See also #208 .