Browse Source
This commit applies several optimizations to StringUtils#cleanPath and related methods: * pre-size pathElements deque in StringUtils#cleanPath with pathElements.length elements, since this this is the maximum size and the most likely case. * optimize StringUtils#collectionToDelimitedString to calculate the size of the resulting String and avoid array auto-resizing in the StringBuilder. * If the path did not contain any components that required cleaning, return the (normalized) path as-is. No need to concatenate the prefix and the trailing path. See gh-26316pull/27339/head
2 changed files with 42 additions and 4 deletions
Loading…
Reference in new issue