mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-19 20:23:54 +00:00
Merge branch 'asanstats' into 'master'
Fix invalid memory usage in stats tooltip See merge request OpenMW/openmw!3057
This commit is contained in:
commit
7a20af6d9d
1 changed files with 3 additions and 3 deletions
|
@ -274,14 +274,14 @@ namespace MWGui
|
||||||
if (underscorePos == std::string::npos)
|
if (underscorePos == std::string::npos)
|
||||||
continue;
|
continue;
|
||||||
std::string key = userStringPair.first.substr(0, underscorePos);
|
std::string key = userStringPair.first.substr(0, underscorePos);
|
||||||
std::string widgetName = userStringPair.first.substr(
|
std::string_view first = userStringPair.first;
|
||||||
underscorePos + 1, userStringPair.first.size() - (underscorePos + 1));
|
std::string_view widgetName = first.substr(underscorePos + 1);
|
||||||
|
|
||||||
type = "Property";
|
type = "Property";
|
||||||
size_t caretPos = key.find('^');
|
size_t caretPos = key.find('^');
|
||||||
if (caretPos != std::string::npos)
|
if (caretPos != std::string::npos)
|
||||||
{
|
{
|
||||||
type = key.substr(0, caretPos);
|
type = first.substr(0, caretPos);
|
||||||
key.erase(key.begin(), key.begin() + caretPos + 1);
|
key.erase(key.begin(), key.begin() + caretPos + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue