mirror of
https://github.com/savoirfairelinux/opendht.git
synced 2026-11-08 12:28:42 +00:00
NodeCache: handle end() lower_bound for non-empty map
This commit is contained in:
1 parent
9d4e6e0984
commit
be2b9fd7dc
1 file changed
+1
-1
+1
-1
@@ -48,7 +48,7 @@ NodeCache::getCachedNodes(const InfoHash& id, sa_family_t sa_f, size_t count) co
|
||||
|
||||
auto it_p = c.lower_bound(id),
|
||||
it_n = it_p;
|
||||
if (it_p != c.cend())
|
||||
if (not c.empty())
|
||||
dec_it(it_p); /* Create 2 separate iterator if we could */
|
||||
|
||||
while (nodes.size() < count and (it_n != c.cend() or it_p != c.cend())) {
|
||||
|
||||
Reference in new issue
Block a user