Caching: Rename get_hash
to compute_hash
#6347
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
get_hash
method was actually recomputing the hash and not just returning the hash stored in the extras that was computed when the node got stored. Theget_hash
and_get_hash
methods are renamed tocompute_hash
and_compute_hash
, respectively. This allowsget_hash
to be reimplemented to simply return the hash stored in the extras.Although technically speaking this is changing the implementation of public facing API, if users even use
get_hash()
it will have been to retrieve the hash for an already stored node, which is therefore equal to just returning the pre-computed hash stored in the extras. So effectively this should not be a breaking change.