From 186a749150abb2f16ef191192dccbea9bcc2716e Mon Sep 17 00:00:00 2001 From: Gravit Date: Thu, 17 Sep 2020 19:48:11 +0700 Subject: [PATCH] =?UTF-8?q?[FIX]=20=D0=9E=D0=BF=D1=82=D0=B8=D0=BC=D0=B8?= =?UTF-8?q?=D0=B7=D0=B0=D1=86=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../launchserver/socket/handlers/NettyWebAPIHandler.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/handlers/NettyWebAPIHandler.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/handlers/NettyWebAPIHandler.java index f145bd02..39a657a3 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/handlers/NettyWebAPIHandler.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/handlers/NettyWebAPIHandler.java @@ -38,19 +38,17 @@ public SeverletPathPair(String key, SimpleSeverletHandler callback) { this.callback = callback; } } - private static ArrayList severletList = new ArrayList<>(); + private static TreeSet 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)