Rollup merge of #80250 - bugadani:resolver-cleanup, r=petrochenkov
Rollup merge of #80250 - bugadani:resolver-cleanup, r=petrochenkov

Minor cleanups in LateResolver

 - Avoid calculating hash twice
 - Avoid creating a closure in every iteration of a loop
 - Reserve space for path in advance
 - Some readability changes

graydon/rust,aidancully/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust