From 1e1c8c82f98f4a6d6ed77e7bf34ac5177fe33d4f Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Fri, 30 Jul 2010 11:45:52 -0700 Subject: minor speed improvements or URL parsing --- src/services.js | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/services.js b/src/services.js index 6a52d25a..8df23564 100644 --- a/src/services.js +++ b/src/services.js @@ -24,7 +24,7 @@ angularService("$location", function(browser){ if (href) { parseUrl(href); } else { - href = check('href') || check('protocol', '://', 'host', ':', 'port', '', 'path', '?', 'search'); + href = check('href') || checkProtocol(); var hash = check('hash'); if (isUndefined(hash)) hash = checkHashPathSearch(); if (isDefined(hash)) { @@ -38,19 +38,22 @@ angularService("$location", function(browser){ } } - function check() { - var i = -1, - length=arguments.length, - name, seperator, parts = [], - value, same = true; - for(; i