Remove unnecessary flatten! method call.
Merge pull request #15310 from tgxworld/small_refactor_get_routes_as_head

Remove unnecessary flatten! method call.