marcofleon
2025-07-15 16:20:32 +01:00
parent 184159e4f3
commit d588575ed1
4 changed files with 7 additions and 6 deletions

View File

@@ -98,7 +98,8 @@ public:
friend auto operator<=>(const GenTxid& a, const GenTxid& b)
{
return std::tuple(a.IsWtxid(), a.ToUint256()) <=> std::tuple(b.IsWtxid(), b.ToUint256());
// Use a reference for read-only access to the hash, avoiding a copy that might not be optimized away.
return std::tuple<bool, const uint256&>(a.IsWtxid(), a.ToUint256()) <=> std::tuple<bool, const uint256&>(b.IsWtxid(), b.ToUint256());
}
};