Speed up YangParser.addSource() 20/90420/2
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 12 Jun 2020 06:32:34 +0000 (08:32 +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: I00519eb6fedaa9ab27b3b3f13bcc0b10b542f134
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 6da2bdda4365e0de18068f3acd668e3e22688516..cd31239007d3b6027490aed983e39113f7572976 100644 (file)
@@ -63,7 +63,7 @@ final class YangParserImpl implements YangParser {
     @Override
     public @NonNull YangParser addSource(final SchemaSourceRepresentation source) throws IOException,
             YangSyntaxErrorException {
-        buildAction.addSources(sourceToStatementStream(source));
+        buildAction.addSource(sourceToStatementStream(source));
         return this;
     }