diff options
author | md_5 <git@md-5.net> | 2018-10-27 18:22:29 +1100 |
---|---|---|
committer | md_5 <git@md-5.net> | 2018-10-27 18:22:29 +1100 |
commit | 99934bd88a6b2976695d03cffddd4d4bba75ef66 (patch) | |
tree | 6716cfd17cdf2fd68cc4f23e3f29d60f8188058f /src | |
parent | 22452b38c85e0102384f663d80cb179916e9477c (diff) | |
download | bukkit-99934bd88a6b2976695d03cffddd4d4bba75ef66.tar bukkit-99934bd88a6b2976695d03cffddd4d4bba75ef66.tar.gz bukkit-99934bd88a6b2976695d03cffddd4d4bba75ef66.tar.lz bukkit-99934bd88a6b2976695d03cffddd4d4bba75ef66.tar.xz bukkit-99934bd88a6b2976695d03cffddd4d4bba75ef66.zip |
Use String.split for simple splits
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/bukkit/command/SimpleCommandMap.java | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/main/java/org/bukkit/command/SimpleCommandMap.java b/src/main/java/org/bukkit/command/SimpleCommandMap.java index f81ae85d..ba55a9ce 100644 --- a/src/main/java/org/bukkit/command/SimpleCommandMap.java +++ b/src/main/java/org/bukkit/command/SimpleCommandMap.java @@ -18,7 +18,6 @@ import org.bukkit.entity.Player; import org.bukkit.util.StringUtil; public class SimpleCommandMap implements CommandMap { - private static final Pattern PATTERN_ON_SPACE = Pattern.compile(" ", Pattern.LITERAL); protected final Map<String, Command> knownCommands = new HashMap<String, Command>(); private final Server server; @@ -122,7 +121,7 @@ public class SimpleCommandMap implements CommandMap { * {@inheritDoc} */ public boolean dispatch(CommandSender sender, String commandLine) throws CommandException { - String[] args = PATTERN_ON_SPACE.split(commandLine); + String[] args = commandLine.split(" "); if (args.length == 0) { return false; @@ -206,8 +205,7 @@ public class SimpleCommandMap implements CommandMap { return null; } - String argLine = cmdLine.substring(spaceIndex + 1, cmdLine.length()); - String[] args = PATTERN_ON_SPACE.split(argLine, -1); + String[] args = cmdLine.substring(spaceIndex + 1, cmdLine.length()).split(" ", -1); try { return target.tabComplete(sender, commandName, args, location); |