InfoHash: add explicit operator bool()

This commit is contained in:
Adrien Beraud committed 2017-11-01 11:59:11 -04:00
1 parent fcaaa01b2d
commit dc99919338
8 files changed
+27 -17

No files matched your search

+1 -1
View File
@@ -33,7 +33,7 @@ NodeCache::getNode(const InfoHash& id, sa_family_t family) {
Sp<Node>
NodeCache::getNode(const InfoHash& id, const SockAddr& addr, time_point now, bool confirm, bool client) {
if (id == zeroes)
if (not id)
return std::make_shared<Node>(id, addr);
return cache(addr.getFamily()).getNode(id, addr, now, confirm, client);
}