From a65586ea29f1f8382726ad2da9f43591ffddfc6f Mon Sep 17 00:00:00 2001 From: Louis-Dominique Dubeau Date: Mon, 24 Jun 2019 07:24:23 -0400 Subject: [PATCH] perf: move more common/valid cases first --- lib/saxes.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/saxes.js b/lib/saxes.js index f0d05d6f..c8f9369c 100644 --- a/lib/saxes.js +++ b/lib/saxes.js @@ -1597,17 +1597,17 @@ class SaxesParser { if (isS(c)) { this.state = S_ATTRIB; } - else if (isNameStartChar(c)) { - this.fail("no whitespace between attributes."); - this.name = String.fromCodePoint(c); - this.state = S_ATTRIB_NAME; - } else if (c === GREATER) { this.openTag(); } else if (c === FORWARD_SLASH) { this.state = S_OPEN_TAG_SLASH; } + else if (isNameStartChar(c)) { + this.fail("no whitespace between attributes."); + this.name = String.fromCodePoint(c); + this.state = S_ATTRIB_NAME; + } else { this.fail("disallowed character in attribute name."); }