Skip to content

Conversation

rnro
Copy link
Contributor

@rnro rnro commented Aug 29, 2025

TestMetrics.FullKey hash goes via intermediate Dictionary.

Motivation:

Recently a change was made to the TestMetrics.FullKey.hash method to make the hashing output stable and remove its dependency on the order of the key-value pairs.

Modifications:

This PR retains that property but instead of sorting first inserts the key-value pairs into a Dictionary as is done in the == method.

Result:

This is useful because it more clearly indicates that the type will comply with the requirement that anything that is equal must produce the same hash.

Recently a change was made to the `TestMetrics.FullKey.hash` method to
make the hashing output stable and remove its dependency on the order of
the key-value pairs.

This PR retains that property but instead of sorting first inserts the
key-value pairs into a `Dictionary` as is done in the `==` method.

This is useful because it more clearly indicates that the type will
comply with the requirement that anything that is equal must produce
the same hash.
@rnro rnro requested a review from Lukasa August 29, 2025 12:51
@rnro rnro added the semver/none No version bump required. label Aug 29, 2025
@rnro rnro merged commit 73971ac into main Sep 2, 2025
33 checks passed
@rnro rnro deleted the TestMetrics_FullKey_hashing branch September 2, 2025 08:38
@czechboy0 czechboy0 added 🔨 semver/patch No public API change. and removed semver/none No version bump required. labels Sep 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 semver/patch No public API change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants