From 446b3307f90bf5a636d298dc6ffb2eeb9d105578 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Tue, 9 May 2017 14:21:55 +0800 Subject: [PATCH] Make method const --- src/base/bittorrent/session.cpp | 2 +- src/base/bittorrent/trackerentry.cpp | 2 +- src/base/bittorrent/trackerentry.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/base/bittorrent/session.cpp b/src/base/bittorrent/session.cpp index 9c08c15ae..1e8a665d7 100644 --- a/src/base/bittorrent/session.cpp +++ b/src/base/bittorrent/session.cpp @@ -180,7 +180,7 @@ namespace { } - T operator()(T val) + T operator()(T val) const { return val <= m_limit ? m_ret : val; } diff --git a/src/base/bittorrent/trackerentry.cpp b/src/base/bittorrent/trackerentry.cpp index 14f98e738..824f8f1ba 100644 --- a/src/base/bittorrent/trackerentry.cpp +++ b/src/base/bittorrent/trackerentry.cpp @@ -84,7 +84,7 @@ TrackerEntry &TrackerEntry::operator=(const TrackerEntry &other) return *this; } -bool TrackerEntry::operator==(const TrackerEntry &other) +bool TrackerEntry::operator==(const TrackerEntry &other) const { return (QUrl(url()) == QUrl(other.url())); } diff --git a/src/base/bittorrent/trackerentry.h b/src/base/bittorrent/trackerentry.h index f9d2187c4..fcaf9af7d 100644 --- a/src/base/bittorrent/trackerentry.h +++ b/src/base/bittorrent/trackerentry.h @@ -60,7 +60,7 @@ namespace BitTorrent void setTier(int value); TrackerEntry &operator=(const TrackerEntry &other); - bool operator==(const TrackerEntry &other); + bool operator==(const TrackerEntry &other) const; libtorrent::announce_entry nativeEntry() const;