From: Joel Rosdahl Date: Mon, 30 Dec 2024 13:15:57 +0000 (+0100) Subject: chore: Tweak comment and add const X-Git-Tag: v4.11~35 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c6b9a44e48938a3873ff7fc43c7ed47bcf16231b;p=thirdparty%2Fccache.git chore: Tweak comment and add const --- diff --git a/src/ccache/core/common.cpp b/src/ccache/core/common.cpp index df81f8d4..aab32089 100644 --- a/src/ccache/core/common.cpp +++ b/src/ccache/core/common.cpp @@ -93,9 +93,10 @@ make_relative_path(const Context& ctx, const fs::path& path) std::string rewrite_stderr_to_absolute_paths(std::string_view text) { - // Line prefixes from gcc compiler plus extra space at the end - // https://gcc.gnu.org/git?p=gcc.git;a=blob;f=gcc/diagnostic-format-text.cc;h=856d25e8482cd0bff39bd8076e6e529e184362cc;hb=HEAD#l676 - const std::string_view in_file_included_from_msgs[] = { + // Line prefixes from GCC plus extra space at the end. Reference: + // + static const std::string_view in_file_included_from_msgs[] = { " from ", "In file included from ", " included from ", @@ -111,7 +112,7 @@ rewrite_stderr_to_absolute_paths(std::string_view text) "\n", Tokenizer::Mode::include_empty, Tokenizer::IncludeDelimiter::yes)) { - for (auto& in_file_included_from : in_file_included_from_msgs) { + for (const auto& in_file_included_from : in_file_included_from_msgs) { if (util::starts_with(line, in_file_included_from)) { result += in_file_included_from; line = line.substr(in_file_included_from.length());