From f09a3ced0b7a9d450c81063fc9586ba5e7f8f810 Mon Sep 17 00:00:00 2001 From: tippfehlr Date: Fri, 13 Feb 2026 01:16:07 +0100 Subject: [PATCH] Update function signatures to use string_view --- src/MessageTypeStore.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/MessageTypeStore.cpp b/src/MessageTypeStore.cpp index 44c94ec7..fbc38586 100644 --- a/src/MessageTypeStore.cpp +++ b/src/MessageTypeStore.cpp @@ -5,6 +5,7 @@ #include #include +#include #include #include @@ -19,10 +20,10 @@ using namespace Arcus; * of std::hash differs between compilers, we need to make sure we use the same * implementation everywhere. */ -uint32_t hash(const std::string& input) +uint32_t hash(std::string_view input) { - const char* data = input.c_str(); - uint32_t length = input.size(); + const char* data = input.data(); + uint32_t length = static_cast(input.size()); uint32_t result = static_cast(2166136261UL); for (; length; --length) { @@ -39,7 +40,7 @@ class ErrorCollector : public google::protobuf::compiler::MultiFileErrorCollecto { } - void AddError(const std::string& filename, int line, int column, const std::string& message) override + void RecordError(absl::string_view filename, int line, int column, absl::string_view message) override { _stream << "[" << filename << " (" << line << "," << column << ")] " << message << std::endl; _error_count++;