Use std::unordered_set instead of std::vector in IsEvicted()
Summary:
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>
This is a backport of core#20197 [3/6]
https://github.com/bitcoin/bitcoin/pull/20197/commits/ca63b53ecdf377ce777fd959d400748912266748
Depends on D10976
Test Plan: ninja check
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D10977