mirror of
https://github.com/OpenMW/openmw.git
synced 2025-12-20 16:23:15 +00:00
Explicitly check if inputString is empty or only contains spaces in generatePatternArray to improve performance
This commit is contained in:
parent
225d8f0b90
commit
336a9e7da1
1 changed files with 2 additions and 0 deletions
|
|
@ -945,6 +945,8 @@ namespace MWGui
|
|||
{
|
||||
std::vector<std::string> generatePatternArray(std::string inputString)
|
||||
{
|
||||
if (inputString.empty() || inputString.find_first_not_of(" ") == std::string::npos)
|
||||
return std::vector<std::string>();
|
||||
Misc::StringUtils::lowerCaseInPlace(inputString);
|
||||
std::istringstream stringStream(inputString);
|
||||
return { std::istream_iterator<std::string>(stringStream), std::istream_iterator<std::string>() };
|
||||
|
|
|
|||
Loading…
Reference in a new issue