very very minor performance improvement

There's no need to create a list of objects, just to check their IDs. We already
have the IDs in our $path.

--HG--
branch : 0.9
extra : rebase_source : fbdf7e83386f81c3d30c9e37cc5d77d2292b6be0