mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-22 16:41:46 +03:00
[FIX] Оптимизация
This commit is contained in:
parent
5413ba0dd7
commit
186a749150
1 changed files with 1 additions and 3 deletions
|
@ -38,19 +38,17 @@ public SeverletPathPair(String key, SimpleSeverletHandler callback) {
|
|||
this.callback = callback;
|
||||
}
|
||||
}
|
||||
private static ArrayList<SeverletPathPair> severletList = new ArrayList<>();
|
||||
private static TreeSet<SeverletPathPair> severletList = new TreeSet<>(Comparator.comparingInt((e) -> -e.key.length()));
|
||||
public static SeverletPathPair addNewSeverlet(String path, SimpleSeverletHandler callback)
|
||||
{
|
||||
SeverletPathPair pair = new SeverletPathPair("/webapi/".concat(path), callback);
|
||||
severletList.add(pair);
|
||||
severletList.sort(Comparator.comparingInt((a) -> -a.key.length()));
|
||||
return pair;
|
||||
}
|
||||
public static SeverletPathPair addUnsafeSeverlet(String path, SimpleSeverletHandler callback)
|
||||
{
|
||||
SeverletPathPair pair = new SeverletPathPair(path, callback);
|
||||
severletList.add(pair);
|
||||
severletList.sort(Comparator.comparingInt((a) -> -a.key.length()));
|
||||
return pair;
|
||||
}
|
||||
public static void removeSeverlet(SeverletPathPair pair)
|
||||
|
|
Loading…
Reference in a new issue