Avoid redundant lowerCase call

post_malone
elsid 2 years ago
parent ba69146ced
commit 228a0dc723
No known key found for this signature in database
GPG Key ID: 4DE04C198CBA7625

@ -391,10 +391,8 @@ std::string CSMWorld::Columns::getName (ColumnId column)
int CSMWorld::Columns::getId (const std::string& name)
{
std::string name2 = Misc::StringUtils::lowerCase (name);
for (int i=0; sNames[i].mName; ++i)
if (Misc::StringUtils::ciEqual(std::string_view(sNames[i].mName), name2))
if (Misc::StringUtils::ciEqual(std::string_view(sNames[i].mName), name))
return sNames[i].mId;
return -1;

@ -354,9 +354,8 @@ CSMWorld::LandTextureIdTable::ImportResults CSMWorld::LandTextureIdTable::import
for (int i = 0; i < idCollection()->getSize(); ++i)
{
auto& record = static_cast<const Record<LandTexture>&>(idCollection()->getRecord(i));
std::string texture = Misc::StringUtils::lowerCase(record.get().mTexture);
if (record.isModified())
reverseLookupMap.emplace(texture, idCollection()->getId(i));
reverseLookupMap.emplace(Misc::StringUtils::lowerCase(record.get().mTexture), idCollection()->getId(i));
}
for (const std::string& id : ids)

Loading…
Cancel
Save