From 5ded326157d9377e564068a265b647c4fea625ff Mon Sep 17 00:00:00 2001 From: Louis-Dominique Dubeau Date: Tue, 21 Aug 2018 20:52:37 -0400 Subject: [PATCH] perf: remove some redundant buffer resets --- lib/saxes.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/lib/saxes.js b/lib/saxes.js index 0217ed8e..9dd9ff54 100644 --- a/lib/saxes.js +++ b/lib/saxes.js @@ -737,7 +737,6 @@ class SaxesParser { switch (c) { case FORWARD_SLASH: this.state = S_CLOSE_TAG; - this.tagName = ""; this.xmlDeclPossible = false; break; case BANG: @@ -747,7 +746,6 @@ class SaxesParser { break; case QUESTION: this.state = S_PI; - this.piTarget = this.piBody = ""; break; default: this.fail("disallowed characer in tag name."); @@ -774,11 +772,9 @@ class SaxesParser { } this.state = S_CDATA; this.openWakaBang = ""; - this.cdata = ""; break; case "--": this.state = S_COMMENT; - this.comment = ""; this.openWakaBang = ""; break; case "DOCTYPE": @@ -786,7 +782,6 @@ class SaxesParser { if (this.doctype || this.sawRoot) { this.fail("inappropriately located doctype declaration."); } - this.doctype = ""; this.openWakaBang = ""; break; default: @@ -1085,7 +1080,6 @@ class SaxesParser { this.q = c; } this.xmlDeclState = S_XML_DECL_VALUE; - this.xmlDeclValue = ""; } break; case S_XML_DECL_VALUE: @@ -1173,6 +1167,7 @@ class SaxesParser { } this.xmlDeclName = this.xmlDeclValue = ""; this.requiredSeparator = undefined; + this.piTarget = this.piBody = ""; this.state = S_TEXT; } else { @@ -1242,7 +1237,6 @@ class SaxesParser { tag.ns = Object.create(null); } - this.attribList = []; this.emitNode("onopentagstart", tag); switch (c) { @@ -1747,7 +1741,6 @@ class SaxesParser { } this.state = S_TEXT; this.tagName = ""; - this.attribName = this.attribValue = ""; } /**