More efficient implementation of an earlier fix so that id is searched only once

- see commit 306bfcbdf2
pull/541/head
cc9cii 9 years ago
parent 477e0ee912
commit 76e9a03596

@ -163,9 +163,9 @@ void CSMWorld::IdTable::cloneRecord(const std::string& origin,
///This method can return only indexes to the top level table cells
QModelIndex CSMWorld::IdTable::getModelIndex (const std::string& id, int column) const
{
int idx = mIdCollection->searchId (id);
if (idx != -1)
return index(mIdCollection->getIndex (id), column);
int row = mIdCollection->searchId (id);
if (row != -1)
return index(row, column);
else
return QModelIndex();
}

Loading…
Cancel
Save