While trying to understand this code, I was confused about what the purpose of PendingInLocs is. As far as I can see, it ends up having the same result as InLocs, just computed in a more roundabout way. Am I missing something here?
With PendingInLocs gone, the computation of the Diff and Removed sets also seems unnecessary, and we can just compare if the old and the new set are the same.