One requirement for the function HashMap::compute is that the function are "pure" because they can be called several times.
However, that seems too strong.
Instead, the right condition should be that the function is idempotent, that is returns the same result when called several times.
One requirement for the function
HashMap::computeis that the function are "pure" because they can be called several times.However, that seems too strong.
Instead, the right condition should be that the function is idempotent, that is returns the same result when called several times.