Skip to content

Commit 101012e

Browse files
committed
perf($urlRouter): only call $location.port() once
1 parent bba61cd commit 101012e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/urlRouter.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -393,8 +393,8 @@ function $UrlRouterProvider( $locationProvider, $urlMatcherFactory) {
393393
return url;
394394
}
395395

396-
var slash = (!isHtml5 && url ? '/' : ''),
397-
port = $location.port() == 80 || $location.port() == 443 ? '' : ':' + $location.port();
396+
var slash = (!isHtml5 && url ? '/' : ''), port = $location.port();
397+
port = (port === 80 || port === 443 ? '' : ':' + port);
398398

399399
return [$location.protocol(), '://', $location.host(), port, slash, url].join('');
400400
}

0 commit comments

Comments
 (0)