diff --git a/src/common/bspf.hxx b/src/common/bspf.hxx index a5f37de17..9a7f217b0 100644 --- a/src/common/bspf.hxx +++ b/src/common/bspf.hxx @@ -427,7 +427,8 @@ namespace BSPF inline bool isWhiteSpace(const char c) { - return string(" ,.;:+-*&/\\'").find(c) != string::npos; + static constexpr string_view spaces{" ,.;:+-*&/\\'"}; + return spaces.find(c) != string_view::npos; } } // namespace BSPF diff --git a/src/emucore/FBSurface.hxx b/src/emucore/FBSurface.hxx index ef2390cf9..b46db8485 100644 --- a/src/emucore/FBSurface.hxx +++ b/src/emucore/FBSurface.hxx @@ -411,7 +411,8 @@ class FBSurface @return True if whitespace character */ static bool isWhiteSpace(const char c) { - return string(" ,.;:+-*/\\'([\n").find(c) != string::npos; + static constexpr string_view spaces{" ,.;:+-*/\\'([\n"}; + return spaces.find(c) != string_view::npos; } protected: