From b8e92fb3d4137f91fe6a54829867fc54357da648 Mon Sep 17 00:00:00 2001 From: Eugene Siegel Date: Fri, 25 Jul 2025 16:39:33 -0400 Subject: [PATCH] log: avoid double hashing in SourceLocationHasher Co-Authored-By: l0rinc --- src/logging.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/logging.h b/src/logging.h index c801e94e289..33742dcbe68 100644 --- a/src/logging.h +++ b/src/logging.h @@ -46,10 +46,10 @@ struct SourceLocationHasher { size_t operator()(const std::source_location& s) const noexcept { // Use CSipHasher(0, 0) as a simple way to get uniform distribution. - return static_cast(CSipHasher(0, 0) - .Write(std::hash{}(s.file_name())) - .Write(s.line()) - .Finalize()); + return size_t(CSipHasher(0, 0) + .Write(s.line()) + .Write(MakeUCharSpan(std::string_view{s.file_name()})) + .Finalize()); } };