diff --git a/src/MessageTypeStore.cpp b/src/MessageTypeStore.cpp index 44c94ec..fbc3858 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++;