Skip to content

Commit 0cc37c7

Browse files
TimothyGuevanlucas
authored andcommitted
querystring: move isHexTable to internal
PR-URL: #12507 Reviewed-By: James M Snell <[email protected]>
1 parent 72a3cac commit 0cc37c7

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

lib/internal/querystring.js

+20
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,32 @@ const hexTable = new Array(256);
44
for (var i = 0; i < 256; ++i)
55
hexTable[i] = '%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase();
66

7+
const isHexTable = [
8+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 15
9+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 16 - 31
10+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 32 - 47
11+
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, // 48 - 63
12+
0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 64 - 79
13+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 80 - 95
14+
0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 96 - 111
15+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 112 - 127
16+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 128 ...
17+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
18+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
19+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
20+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
21+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
22+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
23+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // ... 256
24+
];
25+
726
// Instantiating this is faster than explicitly calling `Object.create(null)`
827
// to get a "clean" empty object (tested with v8 v4.9).
928
function StorageObject() {}
1029
StorageObject.prototype = Object.create(null);
1130

1231
module.exports = {
1332
hexTable,
33+
isHexTable,
1434
StorageObject
1535
};

0 commit comments

Comments
 (0)