Skip to content

Commit cc79051

Browse files
committed
Move 1-liner to header file
1 parent 74da8a3 commit cc79051

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/utils.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
#include <iterator>
66

77
namespace Exiv2 {
8-
bool startsWith(std::string_view s, std::string_view start) {
9-
return s.find(start) == 0;
10-
}
118

129
std::string upper(const std::string& str) {
1310
std::string result;

src/utils.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
#include <string_view>
66

77
namespace Exiv2 {
8-
bool startsWith(std::string_view s, std::string_view start);
8+
constexpr bool startsWith(std::string_view s, std::string_view start) {
9+
return s.find(start) == 0;
10+
}
911

1012
/// @brief Returns the uppercase version of \b str
1113
std::string upper(const std::string& str);

0 commit comments

Comments
 (0)