move domain() and getUri() out of foreach loop
Merge pull request #5267 from alprs/perf/RouteCollection-addToCollections

Move domain() and getUri() out of foreach loop