dadhi / ImTools

Fast and memory-efficient immutable collections and helper data structures
MIT License
232 stars 10 forks source link

Replace the ImMap methods with Update delegate parameter with composable Add and Update methods #40

Closed dadhi closed 3 years ago

dadhi commented 3 years ago

To improve the extensibility I have introduced the base GetOrAddEntry and ReplaceEntry methods. Another important thing is to inversion the control, instead of passing the delegates to operate on the particular type of Entry (either Single entry or Conflicting Hash entry) the GetOrAddEntry is returning the entry, then it can be updated or added based on the type on the consumer side, and then passed to the ReplaceEntry.