From 78cb48b23ca7caa790788518da37ccba438d44f4 Mon Sep 17 00:00:00 2001 From: Steveice10 <1269164+Steveice10@users.noreply.github.com> Date: Fri, 3 Feb 2023 10:01:10 -0800 Subject: [PATCH] common: Make TrimSourcePath constexpr (#6279) --- src/common/logging/log.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/logging/log.h b/src/common/logging/log.h index 1109ce7c3..cf3cf0dea 100644 --- a/src/common/logging/log.h +++ b/src/common/logging/log.h @@ -11,7 +11,7 @@ namespace Log { // trims up to and including the last of ../, ..\, src/, src\ in a string -inline const char* TrimSourcePath(std::string_view source) { +constexpr const char* TrimSourcePath(std::string_view source) { const auto rfind = [source](const std::string_view match) { return source.rfind(match) == source.npos ? 0 : (source.rfind(match) + match.size()); };