mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-01 19:06:40 +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)
|
void CSMWorld::CommandDispatcher::setSelection(const std::vector<std::string>& selection)
|
||||||
{
|
{
|
||||||
mSelection = selection;
|
mSelection = selection;
|
||||||
for (auto& sel : mSelection)
|
std::sort(mSelection.begin(), mSelection.end(), Misc::StringUtils::CiComp{});
|
||||||
{
|
|
||||||
Misc::StringUtils::lowerCaseInPlace(sel);
|
|
||||||
}
|
|
||||||
std::sort(mSelection.begin(), mSelection.end());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSMWorld::CommandDispatcher::setExtendedTypes(const std::vector<UniversalId>& types)
|
void CSMWorld::CommandDispatcher::setExtendedTypes(const std::vector<UniversalId>& types)
|
||||||
|
@ -290,8 +286,7 @@ void CSMWorld::CommandDispatcher::executeExtendedDelete()
|
||||||
if (record.mState == RecordBase::State_Deleted)
|
if (record.mState == RecordBase::State_Deleted)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!std::binary_search(mSelection.begin(), mSelection.end(),
|
if (!std::binary_search(mSelection.begin(), mSelection.end(), record.get().mCell))
|
||||||
Misc::StringUtils::lowerCase(record.get().mCell.getRefIdString())))
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
macro.push(new CSMWorld::DeleteCommand(model, record.get().mId.getRefIdString()));
|
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);
|
const Record<CellRef>& record = collection.getRecord(i);
|
||||||
|
|
||||||
if (!std::binary_search(mSelection.begin(), mSelection.end(),
|
if (!std::binary_search(mSelection.begin(), mSelection.end(), record.get().mCell))
|
||||||
Misc::StringUtils::lowerCase(record.get().mCell.getRefIdString())))
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
macro.push(new CSMWorld::RevertCommand(model, record.get().mId.getRefIdString()));
|
macro.push(new CSMWorld::RevertCommand(model, record.get().mId.getRefIdString()));
|
||||||
|
|
Loading…
Reference in a new issue