Speed up YangParser.addSource() 26/90426/1
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 08:19:42 +0000 (10:19 +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>
(cherry picked from commit eb136faf8b1e819b1794a212d1d8a5dce1dd218f)

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;
     }