Commit graph

2 commits

Author SHA1 Message Date
Jon Atack
ca63b53ecd
Use std::unordered_set instead of std::vector in IsEvicted()
An unordered set can tell if an element is present in ~O(1) time (constant on
average, worst case linear to the size of the container), which speeds up and
simplifies the lookup in IsEvicted().

Co-authored-by: Vasil Dimov <vd@FreeBSD.org>
2021-03-19 20:11:41 +01:00
Jon Atack
41f84d5ecc
Move peer eviction tests to a separate test file
out of net_tests, because the eviction tests:

- are a different domain of test coverage, with different dependencies

- run more slowly than the net tests

- will be growing in size, in this PR branch and in the future, as eviction
  test coverage is improved
2021-03-19 20:11:39 +01:00