From b4baeaaf234e6eae2e8afb9d46735f7c7e698c65 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Tue, 9 May 2017 14:15:45 +0800 Subject: [PATCH] Pass arguemnts by const reference --- src/base/torrentfilter.cpp | 4 ++-- src/base/torrentfilter.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/base/torrentfilter.cpp b/src/base/torrentfilter.cpp index 09daf45dc..db9519063 100644 --- a/src/base/torrentfilter.cpp +++ b/src/base/torrentfilter.cpp @@ -49,14 +49,14 @@ TorrentFilter::TorrentFilter() { } -TorrentFilter::TorrentFilter(Type type, QStringSet hashSet, QString category) +TorrentFilter::TorrentFilter(const Type type, const QStringSet &hashSet, const QString &category) : m_type(type) , m_category(category) , m_hashSet(hashSet) { } -TorrentFilter::TorrentFilter(QString filter, QStringSet hashSet, QString category) +TorrentFilter::TorrentFilter(const QString &filter, const QStringSet &hashSet, const QString &category) : m_type(All) , m_category(category) , m_hashSet(hashSet) diff --git a/src/base/torrentfilter.h b/src/base/torrentfilter.h index 1efde98be..06c18b346 100644 --- a/src/base/torrentfilter.h +++ b/src/base/torrentfilter.h @@ -72,8 +72,8 @@ public: TorrentFilter(); // category: pass empty string for "no category" or null string (QString()) for "any category" - TorrentFilter(Type type, QStringSet hashSet = AnyHash, QString category = AnyCategory); - TorrentFilter(QString filter, QStringSet hashSet = AnyHash, QString category = AnyCategory); + TorrentFilter(const Type type, const QStringSet &hashSet = AnyHash, const QString &category = AnyCategory); + TorrentFilter(const QString &filter, const QStringSet &hashSet = AnyHash, const QString &category = AnyCategory); bool setType(Type type); bool setTypeByName(const QString &filter);