summaryrefslogtreecommitdiff
path: root/lib/url.js
diff options
context:
space:
mode:
authorVse Mozhet Byt <vsemozhetbyt@gmail.com>2017-06-16 20:14:58 +0300
committerVse Mozhet Byt <vsemozhetbyt@gmail.com>2017-06-19 18:07:52 +0300
commit878990498a246488dfe5393ddc89b2b15f395a4d (patch)
tree09518527781b28991d44039a40d0a221992b0756 /lib/url.js
parentb9457717cab131a0f6e58b12f4b65a7aae4ecc30 (diff)
downloadandroid-node-v8-878990498a246488dfe5393ddc89b2b15f395a4d.tar.gz
android-node-v8-878990498a246488dfe5393ddc89b2b15f395a4d.tar.bz2
android-node-v8-878990498a246488dfe5393ddc89b2b15f395a4d.zip
readline,repl,url,util: remove needless capturing
Use non-capturing grouping or remove capturing completely when: * capturing is useless per se, e.g. in test() check; * captured groups are not used afterwards at all; * some of the later captured groups are not used afterwards. PR-URL: https://github.com/nodejs/node/pull/13718 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Diffstat (limited to 'lib/url.js')
-rw-r--r--lib/url.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/url.js b/lib/url.js
index 8a76d1fc10..f3ebbec7b1 100644
--- a/lib/url.js
+++ b/lib/url.js
@@ -56,7 +56,7 @@ function Url() {
// define these here so at least they only have to be
// compiled once on the first module load.
-const protocolPattern = /^([a-z0-9.+-]+:)/i;
+const protocolPattern = /^[a-z0-9.+-]+:/i;
const portPattern = /:[0-9]*$/;
const hostPattern = /^\/\/[^@/]+@[^@/]+/;