There was also my previous comment about making `files` a set and making this function a generator.