Skip to content

Commit

Permalink
perf: use isCharAndNotRestricted rather than call two functions
Browse files Browse the repository at this point in the history
  • Loading branch information
lddubeau committed Sep 12, 2019
1 parent af962b4 commit f0b67a4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions lib/saxes.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
const {
isS, isChar: isChar10, isNameStartChar, isNameChar, S_LIST, NAME_RE,
} = require("xmlchars/xml/1.0/ed5");
const { isChar: isChar11, isRestrictedChar } = require("xmlchars/xml/1.1/ed2");
const { isChar: isChar11, isCharAndNotRestricted } =
require("xmlchars/xml/1.1/ed2");
const { isNCNameStartChar, isNCNameChar, NC_NAME_RE } =
require("xmlchars/xmlns/1.0/ed3");

Expand Down Expand Up @@ -707,7 +708,7 @@ class SaxesParser {

// In XML 1.1 the character we read must satisfy the Char production but
// not the RestrictedChar production.
if (!isChar11(code) || isRestrictedChar(code)) {
if (!isCharAndNotRestricted(code)) {
this.fail("disallowed character.");
}
}
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f0b67a4

Please sign in to comment.