1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-04 12:39:55 +00:00

Avoid nested ifs

This commit is contained in:
elsid 2023-03-08 01:10:12 +01:00
parent c8402c0b14
commit 899c302b14
No known key found for this signature in database
GPG Key ID: 4DE04C198CBA7625

View File

@ -298,10 +298,12 @@ int CSMWorld::IdTable::findColumnIndex(Columns::ColumnId id) const
void CSMWorld::IdTable::reorderRows(int baseIndex, const std::vector<int>& newOrder) void CSMWorld::IdTable::reorderRows(int baseIndex, const std::vector<int>& newOrder)
{ {
if (!newOrder.empty()) if (newOrder.empty())
if (mIdCollection->reorderRows(baseIndex, newOrder)) return;
emit dataChanged(index(baseIndex, 0), if (!mIdCollection->reorderRows(baseIndex, newOrder))
index(baseIndex + static_cast<int>(newOrder.size()) - 1, mIdCollection->getColumns() - 1)); return;
emit dataChanged(
index(baseIndex, 0), index(baseIndex + static_cast<int>(newOrder.size()) - 1, mIdCollection->getColumns() - 1));
} }
std::pair<CSMWorld::UniversalId, std::string> CSMWorld::IdTable::view(int row) const std::pair<CSMWorld::UniversalId, std::string> CSMWorld::IdTable::view(int row) const