From 76e9a0359669371bdf06936224a2f7668104f3b5 Mon Sep 17 00:00:00 2001 From: cc9cii Date: Fri, 18 Dec 2015 19:41:19 +1100 Subject: [PATCH] More efficient implementation of an earlier fix so that id is searched only once - see commit 306bfcbdf21a0292775b644e57a0c1f8606d7226 --- apps/opencs/model/world/idtable.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/opencs/model/world/idtable.cpp b/apps/opencs/model/world/idtable.cpp index ec492a91f..6365a78c1 100644 --- a/apps/opencs/model/world/idtable.cpp +++ b/apps/opencs/model/world/idtable.cpp @@ -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(); }