diff options
author | Timothy Gu <timothygu99@gmail.com> | 2017-03-19 16:11:10 -0700 |
---|---|---|
committer | Timothy Gu <timothygu99@gmail.com> | 2017-03-24 15:25:49 -0700 |
commit | cfc8422a68c92808a4a2aee374623bebc768522a (patch) | |
tree | a5ca63de5fee40991d49a5731fe32e3072f097b0 /lib/querystring.js | |
parent | 14a91957f8bce2d614ec361f982aa56378f1c24e (diff) | |
download | android-node-v8-cfc8422a68c92808a4a2aee374623bebc768522a.tar.gz android-node-v8-cfc8422a68c92808a4a2aee374623bebc768522a.tar.bz2 android-node-v8-cfc8422a68c92808a4a2aee374623bebc768522a.zip |
lib: use Object.create(null) directly
After V8 5.6, using Object.create(null) directly is now faster than
using a constructor for map-like objects.
PR-URL: https://github.com/nodejs/node/pull/11930
Refs: https://github.com/emberjs/ember.js/issues/15001
Refs: https://crrev.com/532c16eca071df3ec8eed394dcebb932ef584ee6
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'lib/querystring.js')
-rw-r--r-- | lib/querystring.js | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/querystring.js b/lib/querystring.js index 1533c8d87b..1976c8e125 100644 --- a/lib/querystring.js +++ b/lib/querystring.js @@ -25,7 +25,6 @@ const { Buffer } = require('buffer'); const { - StorageObject, hexTable, isHexTable } = require('internal/querystring'); @@ -281,7 +280,7 @@ const defEqCodes = [61]; // = // Parse a key/val string. function parse(qs, sep, eq, options) { - const obj = new StorageObject(); + const obj = Object.create(null); if (typeof qs !== 'string' || qs.length === 0) { return obj; |