mirror of https://github.com/stella-emu/stella.git
Minor string optimizations.
This commit is contained in:
parent
9cc804d0e0
commit
89fb53a510
|
@ -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
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue