Skip to content

v1.3.0 add SetIfPresent

Compare
Choose a tag to compare
@C-Pro C-Pro released this 18 Oct 07:06
· 5 commits to main since this release
b63990f

New function for atomic SetIfPresent operation:

// SetIfPresent sets the kv only if the key was already present
// and returns the previous value (if any) and whether the insertion was performed
SetIfPresent(K, V) (V, bool)

kudos for @arthhhhh23 for implementing this