Skip to content

Commit

Permalink
Use constexpr.
Browse files Browse the repository at this point in the history
  • Loading branch information
sa666666 committed Dec 5, 2024
1 parent e2f59ae commit 8d5eb28
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/common/bspf.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ namespace BSPF

// Find location (if any) of the second string within the first,
// starting from 'startpos' in the first string
static size_t findIgnoreCase(string_view s1, string_view s2, size_t startpos = 0)
static constexpr size_t findIgnoreCase(string_view s1, string_view s2, size_t startpos = 0)
{
const auto pos = std::search(s1.cbegin()+startpos, s1.cend(), // NOLINT
s2.cbegin(), s2.cend(), [](char ch1, char ch2) {
Expand All @@ -262,7 +262,7 @@ namespace BSPF
}

// Test whether the first string contains the second one (case insensitive)
inline bool containsIgnoreCase(string_view s1, string_view s2)
inline constexpr bool containsIgnoreCase(string_view s1, string_view s2)
{
return findIgnoreCase(s1, s2) != string::npos;
}
Expand Down
2 changes: 1 addition & 1 deletion src/os/windows/FSNodeWINDOWS.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ FSNodeWINDOWS::FSNodeWINDOWS(string_view p)
bool FSNodeWINDOWS::setFlags()
{
// Get absolute path
TCHAR buf[MAX_PATH];
static TCHAR buf[MAX_PATH];
if (GetFullPathName(_path.c_str(), MAX_PATH - 1, buf, NULL))
_path = buf;

Expand Down

0 comments on commit 8d5eb28

Please sign in to comment.