That change was from an earlier commit (f8f3455) which changed the _registry from a list to a dict. It's moved inside the loop because a registry entry is created for each name a unit has.  There was something that was made more efficient this way but I can't remember what exactly.