diff options
author | Swiftb0y <12380386+Swiftb0y@users.noreply.github.com> | 2021-04-18 20:31:54 +0200 |
---|---|---|
committer | Swiftb0y <12380386+Swiftb0y@users.noreply.github.com> | 2021-04-19 13:08:06 +0200 |
commit | 14b7560f8bca1d04abf01bb01f53ec3dadf596e8 (patch) | |
tree | 7f315b95db1494e092a260a0b2cd2018cf163902 /src/preferences | |
parent | ffaa010a0f82d1c8be47dff427cc311e38c4e9fc (diff) |
ColorPaletteEditorModel: reduce nesting
Diffstat (limited to 'src/preferences')
-rw-r--r-- | src/preferences/colorpaletteeditormodel.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/preferences/colorpaletteeditormodel.cpp b/src/preferences/colorpaletteeditormodel.cpp index f0c8d9a096..8c4d302d73 100644 --- a/src/preferences/colorpaletteeditormodel.cpp +++ b/src/preferences/colorpaletteeditormodel.cpp @@ -89,12 +89,14 @@ bool ColorPaletteEditorModel::setData(const QModelIndex& modelIndex, const QVari for (int i = 0; i < rowCount(); ++i) { auto* pHotcueIndexListItem = toHotcueIndexListItem(item(i, 1)); - if (pHotcueIndexListItem) { - if (i == modelIndex.row()) { - pHotcueIndexListItem->setHotcueIndexList(hotcueIndexList); - } else { - pHotcueIndexListItem->removeIndicies(hotcueIndexList); - } + if (pHotcueIndexListItem == nullptr) { + continue; + } + + if (i == modelIndex.row()) { + pHotcueIndexListItem->setHotcueIndexList(hotcueIndexList); + } else { + pHotcueIndexListItem->removeIndicies(hotcueIndexList); } } |