Unroll the pointer-check cache loop.

This commit is contained in:
Axel Naumann
2018-05-24 09:25:20 +02:00
committed by sftnight
parent f2bcf29b1c
commit eb9fbe9f2c

View File

@ -70,8 +70,9 @@ namespace {
bool operator () (const void* P) {
if (FD == -1)
return false;
if (std::find(lines.begin(), lines.end(), P) != lines.end())
// std::find is considerably slower, do manual search instead.
if (P == lines[0] || P == lines[1] || P == lines[2] || P == lines[3]
|| P == lines[4] || P == lines[5] || P == lines[6] || P == lines[7])
return true;
// There is a POSIX way of finding whether an address