Update JVMHelper.java

Optimized "for" loop
This commit is contained in:
Anatoliy 2018-12-05 21:56:15 +02:00 committed by Gravit
parent 1b516ccf2f
commit e7846adaf2

View file

@ -100,16 +100,15 @@ public static String[] getClassPath() {
public static URL[] getClassPathURL() {
String[] cp = System.getProperty("java.class.path").split(File.pathSeparator);
URL[] list = new URL[cp.length];
int it = 0;
for (String s : cp) {
for(int i = 0; i < cp.length; i++) {
URL url = null;
try {
url = new URL(s);
url = new URL(cp[i]);
} catch (MalformedURLException e) {
e.printStackTrace();
}
list[it] = url;
it++;
list[i] = url;
}
return list;
}