Speed up YangParser.addLibSource() 21/90421/1
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 12 Jun 2020 06:36:49 +0000 (08:36 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Fri, 12 Jun 2020 06:37:49 +0000 (08:37 +0200)
Since we are adding a single source only, we can go through
the single-argument method, making things a tad more efficient.

JIRA: YANGTOOLS-652
Change-Id: I676d8d2cbfdd854c9486a02e3c746cb13849d09c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/impl/YangParserImpl.java

index cd31239007d3b6027490aed983e39113f7572976..58151ed70104598925f155e4a71175ee6b572f5a 100644 (file)
@@ -70,7 +70,7 @@ final class YangParserImpl implements YangParser {
     @Override
     public @NonNull YangParser addLibSource(final SchemaSourceRepresentation source) throws IOException,
             YangSyntaxErrorException {
-        buildAction.addLibSources(sourceToStatementStream(source));
+        buildAction.addLibSource(sourceToStatementStream(source));
         return this;
     }