Use the interned stable hash as plain hash.

This commit is contained in:
Camille GILLOT 2022-11-11 12:18:49 +00:00
parent d47424b833
commit 9d86e6abaf
2 changed files with 6 additions and 4 deletions

View file

@ -156,7 +156,11 @@ impl<T> Deref for WithStableHash<T> {
impl<T: Hash> Hash for WithStableHash<T> {
#[inline]
fn hash<H: Hasher>(&self, s: &mut H) {
self.internee.hash(s)
if self.stable_hash != Fingerprint::ZERO {
self.stable_hash.hash(s)
} else {
self.internee.hash(s)
}
}
}