refactor: prefer std::set over QSet (#5703)

* refactor: use std::set instead of QSet in WatchDir.cc

* refactor: use std::set instead of QSet in FileTreeView.cc

* refactor: use std::set instead of QSet in ColumnResizer.cc

* refactor: use std::set instead of QSet in Prefs.cc

* chore: fix rebase error that changed libsmall snapshot

* refactor: more replace QSet with std::set
This commit is contained in:
Charles Kerr
2023-10-24 21:14:37 -04:00
committed by GitHub
parent 69b293a793
commit 237223aeaf
20 changed files with 90 additions and 91 deletions

View File

@@ -6,6 +6,7 @@
#include <algorithm>
#include <cassert>
#include <queue>
#include <set>
#include <QHeaderView>
#include <QMenu>
@@ -253,7 +254,7 @@ void FileTreeView::onlyCheckSelectedItems()
std::sort(wanted_indices.begin(), wanted_indices.end());
QSet<QModelIndex> wanted_indices_parents;
auto wanted_indices_parents = std::set<QModelIndex>{};
for (QModelIndex const& i : wanted_indices)
{
@@ -294,7 +295,7 @@ void FileTreeView::onlyCheckSelectedItems()
{
unwanted_indices << child_index;
}
else if (!wanted_indices_parents.contains(child_index))
else if (wanted_indices_parents.count(child_index) == 0U)
{
unwanted_indices << child_index;
}