mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-08-26 05:41:56 +02:00
log: avoid double hashing in SourceLocationHasher
Co-Authored-By: l0rinc <pap.lorinc@gmail.com>
This commit is contained in:
@@ -46,10 +46,10 @@ struct SourceLocationHasher {
|
|||||||
size_t operator()(const std::source_location& s) const noexcept
|
size_t operator()(const std::source_location& s) const noexcept
|
||||||
{
|
{
|
||||||
// Use CSipHasher(0, 0) as a simple way to get uniform distribution.
|
// Use CSipHasher(0, 0) as a simple way to get uniform distribution.
|
||||||
return static_cast<size_t>(CSipHasher(0, 0)
|
return size_t(CSipHasher(0, 0)
|
||||||
.Write(std::hash<std::string_view>{}(s.file_name()))
|
.Write(s.line())
|
||||||
.Write(s.line())
|
.Write(MakeUCharSpan(std::string_view{s.file_name()}))
|
||||||
.Finalize());
|
.Finalize());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user