Remove unnecessary scopes

This commit is contained in:
TheMode 2021-05-04 23:15:20 +02:00
parent 79a4bd135a
commit 4b6026f18d

View File

@ -420,27 +420,20 @@ public class Command {
jsonObject.add(s, array); jsonObject.add(s, array);
} }
}; };
// Names // Names
{
processor.accept("names", array -> node.names.forEach(array::add)); processor.accept("names", array -> node.names.forEach(array::add));
}
// Nodes // Nodes
{
processor.accept("nodes", array -> processor.accept("nodes", array ->
node.nodes.forEach(n -> { node.nodes.forEach(n -> {
JsonObject nodeObject = new JsonObject(); JsonObject nodeObject = new JsonObject();
processNode(n, nodeObject); processNode(n, nodeObject);
array.add(nodeObject); array.add(nodeObject);
})); }));
}
// Arguments // Arguments
{
processor.accept("arguments", array -> processor.accept("arguments", array ->
node.arguments.forEach(arguments -> node.arguments.forEach(arguments ->
array.add(String.join(StringUtils.SPACE, arguments)))); array.add(String.join(StringUtils.SPACE, arguments))));
} }
}
private static final class Node { private static final class Node {
private final Set<String> names = new HashSet<>(); private final Set<String> names = new HashSet<>();