Permalink
Browse files

Remove duplicate regex match.

  • Loading branch information...
1 parent 244e610 commit 26f9f985bde8ed35f064fde75ad99ad3f10df4fb @andrewdavey committed Jul 21, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/client/vogue-client.js
@@ -104,9 +104,9 @@ function getScriptInfo() {
var scripts = document.getElementsByTagName("script");
var src = scripts[scripts.length - 1].getAttribute("src");
- var url = src.match(/https?\:\/\/.*?\//)[0];
-
- var domain = src.match(/https?\:\/(.*?)\//)[1];
+ var rootMatch = src.match(/https?\:\/\/(.*?)\//);
+ var url = rootMatch[0];
+ var domain = rootMatch[1];
var baseMatch = src.match(/\bbase=(.*)(&|$)/);
if (baseMatch) {

0 comments on commit 26f9f98

Please sign in to comment.