Skip to content

Commit b8e92fb

Browse files
Crypt-iQl0rinc
andcommitted
log: avoid double hashing in SourceLocationHasher
Co-Authored-By: l0rinc <[email protected]>
1 parent 616bc22 commit b8e92fb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/logging.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ struct SourceLocationHasher {
4646
size_t operator()(const std::source_location& s) const noexcept
4747
{
4848
// Use CSipHasher(0, 0) as a simple way to get uniform distribution.
49-
return static_cast<size_t>(CSipHasher(0, 0)
50-
.Write(std::hash<std::string_view>{}(s.file_name()))
51-
.Write(s.line())
52-
.Finalize());
49+
return size_t(CSipHasher(0, 0)
50+
.Write(s.line())
51+
.Write(MakeUCharSpan(std::string_view{s.file_name()}))
52+
.Finalize());
5353
}
5454
};
5555

0 commit comments

Comments
 (0)