I highly suggest not using `lists:keyfind` here, as such + the outer LC leads to O(N^2) behavior. At least 50% of the work I've done on the "large ring" branch has been replacing code like this because we assumed in the past that the input list would always be small and turned out to be wrong "in the large".

Easy fix is to convert `Pairs` into a `dict` before the LC, eg:

```erlang
PairsDict = dict:from_list(Pairs),
[begin
     {_, Pid} = dict:fetch(Idx, 1, PairsDict),
     ...
 end || Idx <- IdxList].
```