Skip to content

Commit

Permalink
perf: remove some redundant buffer resets
Browse files Browse the repository at this point in the history
  • Loading branch information
lddubeau committed Aug 23, 2018
1 parent 2bc3042 commit 5ded326
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions lib/saxes.js
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,6 @@ class SaxesParser {
switch (c) {
case FORWARD_SLASH:
this.state = S_CLOSE_TAG;
this.tagName = "";
this.xmlDeclPossible = false;
break;
case BANG:
Expand All @@ -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.");
Expand All @@ -774,19 +772,16 @@ class SaxesParser {
}
this.state = S_CDATA;
this.openWakaBang = "";
this.cdata = "";
break;
case "--":
this.state = S_COMMENT;
this.comment = "";
this.openWakaBang = "";
break;
case "DOCTYPE":
this.state = S_DOCTYPE;
if (this.doctype || this.sawRoot) {
this.fail("inappropriately located doctype declaration.");
}
this.doctype = "";
this.openWakaBang = "";
break;
default:
Expand Down Expand Up @@ -1085,7 +1080,6 @@ class SaxesParser {
this.q = c;
}
this.xmlDeclState = S_XML_DECL_VALUE;
this.xmlDeclValue = "";
}
break;
case S_XML_DECL_VALUE:
Expand Down Expand Up @@ -1173,6 +1167,7 @@ class SaxesParser {
}
this.xmlDeclName = this.xmlDeclValue = "";
this.requiredSeparator = undefined;
this.piTarget = this.piBody = "";
this.state = S_TEXT;
}
else {
Expand Down Expand Up @@ -1242,7 +1237,6 @@ class SaxesParser {
tag.ns = Object.create(null);
}

this.attribList = [];
this.emitNode("onopentagstart", tag);

switch (c) {
Expand Down Expand Up @@ -1747,7 +1741,6 @@ class SaxesParser {
}
this.state = S_TEXT;
this.tagName = "";
this.attribName = this.attribValue = "";
}

/**
Expand Down

0 comments on commit 5ded326

Please sign in to comment.