-
Enhancement
-
Resolution: Fixed
-
P4
-
None
-
b26
UnixFileSystem.normalize can be simplified to this:
public String normalize(String pathname) {
int doubleSlash = pathname.indexOf("//");
if (doubleSlash >= 0) {
return normalize(pathname, doubleSlash);
}
if (pathname.endsWith("/")) {
return normalize(pathname, pathname.length() - 1);
}
return pathname;
}
.. which is more efficient overall, especially so during startup/warmup (to the tune of a couple of us/op on new File(path)).
public String normalize(String pathname) {
int doubleSlash = pathname.indexOf("//");
if (doubleSlash >= 0) {
return normalize(pathname, doubleSlash);
}
if (pathname.endsWith("/")) {
return normalize(pathname, pathname.length() - 1);
}
return pathname;
}
.. which is more efficient overall, especially so during startup/warmup (to the tune of a couple of us/op on new File(path)).