diff options
Diffstat (limited to 'lib/url.js')
-rw-r--r-- | lib/url.js | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/url.js b/lib/url.js index 72e03e0f9c..3734a0cad6 100644 --- a/lib/url.js +++ b/lib/url.js @@ -28,6 +28,8 @@ const { hexTable } = require('internal/querystring'); const errors = require('internal/errors'); +const { spliceOne } = require('internal/util'); + // WHATWG URL implementation provided by internal/url const { URL, @@ -950,13 +952,6 @@ Url.prototype.parseHost = function parseHost() { if (host) this.hostname = host; }; -// About 1.5x faster than the two-arg version of Array#splice(). -function spliceOne(list, index) { - for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) - list[i] = list[k]; - list.pop(); -} - // These characters do not need escaping: // ! - . _ ~ // ' ( ) * : |