mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-06 07:45:36 +00:00
Avoid redundant conversion to lower case for CommandDispatcher::mSelection items
This commit is contained in:
parent
7daef583cb
commit
191f207e78
1 changed files with 3 additions and 9 deletions
|
@ -113,11 +113,7 @@ void CSMWorld::CommandDispatcher::setEditLock(bool locked)
|
|||
void CSMWorld::CommandDispatcher::setSelection(const std::vector<std::string>& selection)
|
||||
{
|
||||
mSelection = selection;
|
||||
for (auto& sel : mSelection)
|
||||
{
|
||||
Misc::StringUtils::lowerCaseInPlace(sel);
|
||||
}
|
||||
std::sort(mSelection.begin(), mSelection.end());
|
||||
std::sort(mSelection.begin(), mSelection.end(), Misc::StringUtils::CiComp{});
|
||||
}
|
||||
|
||||
void CSMWorld::CommandDispatcher::setExtendedTypes(const std::vector<UniversalId>& types)
|
||||
|
@ -290,8 +286,7 @@ void CSMWorld::CommandDispatcher::executeExtendedDelete()
|
|||
if (record.mState == RecordBase::State_Deleted)
|
||||
continue;
|
||||
|
||||
if (!std::binary_search(mSelection.begin(), mSelection.end(),
|
||||
Misc::StringUtils::lowerCase(record.get().mCell.getRefIdString())))
|
||||
if (!std::binary_search(mSelection.begin(), mSelection.end(), record.get().mCell))
|
||||
continue;
|
||||
|
||||
macro.push(new CSMWorld::DeleteCommand(model, record.get().mId.getRefIdString()));
|
||||
|
@ -321,8 +316,7 @@ void CSMWorld::CommandDispatcher::executeExtendedRevert()
|
|||
{
|
||||
const Record<CellRef>& record = collection.getRecord(i);
|
||||
|
||||
if (!std::binary_search(mSelection.begin(), mSelection.end(),
|
||||
Misc::StringUtils::lowerCase(record.get().mCell.getRefIdString())))
|
||||
if (!std::binary_search(mSelection.begin(), mSelection.end(), record.get().mCell))
|
||||
continue;
|
||||
|
||||
macro.push(new CSMWorld::RevertCommand(model, record.get().mId.getRefIdString()));
|
||||
|
|
Loading…
Reference in a new issue