Skip to content

Commit 88a997b

Browse files
committed
Simplify - no need to build a list out of these items before converting
1 parent da47715 commit 88a997b

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/edu/stanford/nlp/semgraph/semgrex/ssurgeon/ProcessSsurgeonRequest.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,11 @@ public static CoreNLPProtos.SsurgeonResponse processRequest(CoreNLPProtos.Ssurge
5252
xml.append("</ssurgeon-pattern-list>\n");
5353
List<SsurgeonPattern> patterns = inst.readFromString(xml.toString());
5454

55-
List<SemanticGraph> graphs = new ArrayList<>();
55+
CoreNLPProtos.SsurgeonResponse.Builder responseBuilder = CoreNLPProtos.SsurgeonResponse.newBuilder();
5656
for (CoreNLPProtos.DependencyGraph inputGraph : request.getGraphList()) {
5757
List<CoreLabel> tokens = inputGraph.getTokenList().stream().map(serializer::fromProto).collect(Collectors.toList());
5858
SemanticGraph graph = ProtobufAnnotationSerializer.fromProto(inputGraph, tokens, "ssurgeon");
59-
graphs.add(graph);
60-
}
6159

62-
CoreNLPProtos.SsurgeonResponse.Builder responseBuilder = CoreNLPProtos.SsurgeonResponse.newBuilder();
63-
for (SemanticGraph graph : graphs) {
6460
SemanticGraph newGraph = graph;
6561
boolean isChanged = false;
6662
for (SsurgeonPattern pattern : patterns) {

0 commit comments

Comments
 (0)