mirror of
https://github.com/aria2/aria2.git
synced 2026-04-02 02:38:50 +00:00
Fix compiler warning
This commit is contained in:
@@ -59,7 +59,7 @@ DHTPeerAnnounceStorage::DHTPeerAnnounceStorage()
|
||||
|
||||
bool DHTPeerAnnounceStorage::InfoHashLess::
|
||||
operator()(const std::shared_ptr<DHTPeerAnnounceEntry>& lhs,
|
||||
const std::shared_ptr<DHTPeerAnnounceEntry>& rhs)
|
||||
const std::shared_ptr<DHTPeerAnnounceEntry>& rhs) const
|
||||
{
|
||||
return memcmp(lhs->getInfoHash(), rhs->getInfoHash(), DHT_ID_LENGTH) < 0;
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ private:
|
||||
class InfoHashLess {
|
||||
public:
|
||||
bool operator()(const std::shared_ptr<DHTPeerAnnounceEntry>& lhs,
|
||||
const std::shared_ptr<DHTPeerAnnounceEntry>& rhs);
|
||||
const std::shared_ptr<DHTPeerAnnounceEntry>& rhs) const;
|
||||
};
|
||||
typedef std::set<std::shared_ptr<DHTPeerAnnounceEntry>, InfoHashLess>
|
||||
DHTPeerAnnounceEntrySet;
|
||||
|
||||
@@ -143,7 +143,10 @@ namespace {
|
||||
template <typename T> class Unique {
|
||||
typedef T type;
|
||||
struct PointerCmp {
|
||||
inline bool operator()(const type* x, const type* y) { return *x < *y; }
|
||||
inline bool operator()(const type* x, const type* y) const
|
||||
{
|
||||
return *x < *y;
|
||||
}
|
||||
};
|
||||
std::set<const type*, PointerCmp> known;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user