Merge branch 'find_char' into 'master'

Use a char instead of a string in find() where possible

See merge request OpenMW/openmw!781
pull/593/head
Alexei Dobrohotov 4 years ago
commit 6b41bdf7b4

@ -273,7 +273,7 @@ namespace MWGui
std::string widgetName = userStringPair.first.substr(underscorePos+1, userStringPair.first.size()-(underscorePos+1));
type = "Property";
size_t caretPos = key.find("^");
size_t caretPos = key.find('^');
if (caretPos != std::string::npos)
{
type = key.substr(0, caretPos);

@ -1017,8 +1017,9 @@ namespace MWGui
if(tag.compare(0, MyGuiPrefixLength, MyGuiPrefix) == 0)
{
tag = tag.substr(MyGuiPrefixLength, tag.length());
std::string settingSection = tag.substr(0, tag.find(","));
std::string settingTag = tag.substr(tag.find(",")+1, tag.length());
size_t comma_pos = tag.find(',');
std::string settingSection = tag.substr(0, comma_pos);
std::string settingTag = tag.substr(comma_pos+1, tag.length());
_result = Settings::Manager::getString(settingTag, settingSection);
}

@ -966,7 +966,7 @@ void CharacterController::handleTextKey(const std::string &groupname, SceneUtil:
// The event can optionally contain volume and pitch modifiers
float volume=1.f, pitch=1.f;
if (soundgen.find(" ") != std::string::npos)
if (soundgen.find(' ') != std::string::npos)
{
std::vector<std::string> tokens;
split(soundgen, ' ', tokens);

Loading…
Cancel
Save