Optimize args extraction
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Bea 2022-08-26 20:43:49 +02:00
parent ff4ffba45d
commit 8b2fee6aec

View File

@ -11,6 +11,7 @@ import wtf.beatrice.hidekobot.utils.Logger;
import javax.security.auth.login.LoginException; import javax.security.auth.login.LoginException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.List; import java.util.List;
public class HidekoBot public class HidekoBot
@ -73,9 +74,7 @@ public class HidekoBot
// if there are more than 1 args, then iterate through them because we have additional things to do. // if there are more than 1 args, then iterate through them because we have additional things to do.
// we are doing this at the end because we might need the API to be already initialized for some things. // we are doing this at the end because we might need the API to be already initialized for some things.
if(args.length > 1) { if(args.length > 1) {
List<String> argsList = new ArrayList<>(); List<String> argsList = new ArrayList<>(Arrays.asList(args).subList(1, args.length));
for(int i = 1; i < args.length; i++)
{ argsList.add(args[i]); }
if(argsList.contains("verbose")) Configuration.setVerbose(true); if(argsList.contains("verbose")) Configuration.setVerbose(true);
} }