mirror of https://github.com/aria2/aria2
Fix compiler warning
parent
9f5758570a
commit
80df934955
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue