mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 00:51:01 +03:00
[FIX] Более быстрое получение провайдера по названий... (коллекция в которой он хранится lasy fill)
This commit is contained in:
parent
b57ad71539
commit
adefda970e
1 changed files with 8 additions and 6 deletions
|
@ -52,12 +52,15 @@ public LaunchServerConfig setLaunchServer(LaunchServer server) {
|
||||||
public DaoProvider dao;
|
public DaoProvider dao;
|
||||||
|
|
||||||
private transient AuthProviderPair authDefault;
|
private transient AuthProviderPair authDefault;
|
||||||
|
private transient Map<String, AuthProviderPair> authPairs = null;
|
||||||
|
|
||||||
public AuthProviderPair getAuthProviderPair(String name) {
|
public AuthProviderPair getAuthProviderPair(String name) {
|
||||||
for (AuthProviderPair pair : auth) {
|
if (authPairs == null) {
|
||||||
if (pair.name.equals(name)) return pair;
|
Map<String, AuthProviderPair> pairs = new HashMap<>();
|
||||||
}
|
for (AuthProviderPair p : auth) pairs.put(p.name, p);
|
||||||
return null;
|
authPairs = pairs;
|
||||||
|
}
|
||||||
|
return authPairs.get(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ProtectHandler protectHandler;
|
public ProtectHandler protectHandler;
|
||||||
|
@ -125,6 +128,7 @@ public void verify() {
|
||||||
|
|
||||||
public void init(LaunchServer.ReloadType type) {
|
public void init(LaunchServer.ReloadType type) {
|
||||||
Launcher.applyLauncherEnv(env);
|
Launcher.applyLauncherEnv(env);
|
||||||
|
authPairs = null;
|
||||||
for (AuthProviderPair provider : auth) {
|
for (AuthProviderPair provider : auth) {
|
||||||
provider.init(server);
|
provider.init(server);
|
||||||
}
|
}
|
||||||
|
@ -144,8 +148,6 @@ public void init(LaunchServer.ReloadType type) {
|
||||||
server.registerObject("auth.".concat(pair.name).concat(".hwid"), pair.hwid);
|
server.registerObject("auth.".concat(pair.name).concat(".hwid"), pair.hwid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Arrays.stream(mirrors).forEach(server.mirrorManager::addMirror);
|
Arrays.stream(mirrors).forEach(server.mirrorManager::addMirror);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue