-
-
Notifications
You must be signed in to change notification settings - Fork 649
Closed
Description
I am currently evaluating vavr as a replacement for Java 8 Streams. While processing batches of events we always want to keep the last value unique by some key. The semantics would be the same as
.reverse()
.dicstinctBy(e -> e.getSomeKey())
.reverse()
i think.
But i do think that this comes with performance hits. To achieve this we are using a LinkedHashMap where we put elements one after the other with their generated keys and afterwards get the .values() again from that map which will now contain only the last elements of each key.
Would you consider adding "distinctByLast" or as we call it "keepLast" ?
mrDarkHouse