mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
preset StringBuilder capacity to avoid resize
This commit is contained in:
@@ -38,8 +38,8 @@ public class PathUtils {
|
||||
|
||||
public static URI toURI(String localPath) {
|
||||
try {
|
||||
final StringBuilder buf = new StringBuilder();
|
||||
final String p = FileUtilRt.toSystemIndependentName(localPath);
|
||||
final StringBuilder buf = new StringBuilder(p.length() + 3);
|
||||
if (!p.startsWith("/")) {
|
||||
buf.append("///");
|
||||
}
|
||||
|
||||
@@ -25,8 +25,8 @@ public class ZipFileObject extends JpsFileObject {
|
||||
|
||||
@NotNull
|
||||
private static URI createUri(final File zipFile, String relPath) {
|
||||
final StringBuilder buf = new StringBuilder();
|
||||
final String p = FileUtilRt.toSystemIndependentName(zipFile.getPath());
|
||||
final StringBuilder buf = new StringBuilder(p.length() + relPath.length() + 5);
|
||||
if (!p.startsWith("/")) {
|
||||
buf.append("///");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user