mirror of
https://github.com/transmission/transmission.git
synced 2025-12-24 12:28:52 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user