mirror of
https://github.com/i2p/i2p.i2p.git
synced 2026-10-23 13:03:04 +00:00
Kad unit tests:
- Port KBSTest from i2p.zzz.kademlia branch
- Fix RandomTrimmer so it always returns true, so it may be used
as the trimmer in the unit tests
This commit is contained in:
1 parent
1d7eedd463
commit
8699c82614
2 files changed
+128
-10
No files matched your search
@@ -26,6 +26,7 @@ public class RandomTrimmer<T extends SimpleDataStructure> implements KBucketTrim
|
||||
if (sz < _max)
|
||||
return true;
|
||||
T toRemove = e.get(_ctx.random().nextInt(sz));
|
||||
return kbucket.remove(toRemove);
|
||||
kbucket.remove(toRemove);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user