mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 09:01:08 +03:00
Update JVMHelper.java
Optimized "for" loop
This commit is contained in:
parent
1b516ccf2f
commit
e7846adaf2
1 changed files with 4 additions and 5 deletions
|
@ -100,16 +100,15 @@ public static String[] getClassPath() {
|
||||||
public static URL[] getClassPathURL() {
|
public static URL[] getClassPathURL() {
|
||||||
String[] cp = System.getProperty("java.class.path").split(File.pathSeparator);
|
String[] cp = System.getProperty("java.class.path").split(File.pathSeparator);
|
||||||
URL[] list = new URL[cp.length];
|
URL[] list = new URL[cp.length];
|
||||||
int it = 0;
|
|
||||||
for (String s : cp) {
|
for(int i = 0; i < cp.length; i++) {
|
||||||
URL url = null;
|
URL url = null;
|
||||||
try {
|
try {
|
||||||
url = new URL(s);
|
url = new URL(cp[i]);
|
||||||
} catch (MalformedURLException e) {
|
} catch (MalformedURLException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
list[it] = url;
|
list[i] = url;
|
||||||
it++;
|
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue