move `for` two lines down, so we check `isOverrideName` only once and do `getDepthForName` no more than once

if `file` isn't varying among loop iterations, could also cache `UIUtilities.getDisplayedFileName(file.getAbsolutePath(), depth)` value outside the loop