From cc79051b79b427d5d8ddeb3f6c2b35382e098132 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20D=C3=ADaz=20M=C3=A1s?= Date: Wed, 13 Apr 2022 21:06:25 +0200 Subject: [PATCH] Move 1-liner to header file --- src/utils.cpp | 3 --- src/utils.hpp | 4 +++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/utils.cpp b/src/utils.cpp index b3f9effd..57e9fa9d 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -5,9 +5,6 @@ #include namespace Exiv2 { -bool startsWith(std::string_view s, std::string_view start) { - return s.find(start) == 0; -} std::string upper(const std::string& str) { std::string result; diff --git a/src/utils.hpp b/src/utils.hpp index a2bb5c15..a8f21c43 100644 --- a/src/utils.hpp +++ b/src/utils.hpp @@ -5,7 +5,9 @@ #include namespace Exiv2 { -bool startsWith(std::string_view s, std::string_view start); +constexpr bool startsWith(std::string_view s, std::string_view start) { + return s.find(start) == 0; +} /// @brief Returns the uppercase version of \b str std::string upper(const std::string& str);