How about this (I’ve just copied the binary search algorithm from SortedSet, but haven’t tested it):

[code] Entry* findEntry (const uint32 destNodeId, int& insertIndex) const noexcept

{

Entry* result = nullptr;

```
int start = 0;
int end = entries.size();
for (;;)
{
if (start >= end)
{
break;
}
else if (destNodeId == entries.getUnchecked (start)->destNodeId)
{
result = entries.getUnchecked (start);
break;
}
else
{
const int halfway = (start + end) / 2;
if (halfway == start)
{
if (destNodeId >= entries.getUnchecked (halfway)->destNodeId)
++start;
break;
}
else if (destNodeId >= entries.getUnchecked (halfway)->destNodeId)
start = halfway;
else
end = halfway;
}
}
insertIndex = start;
return result;
}
```

[/code]