Skip to content

Commit

Permalink
perf($urlRouter): only call $location.port() once
Browse files Browse the repository at this point in the history
  • Loading branch information
nateabele committed Apr 17, 2014
1 parent bba61cd commit 101012e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/urlRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,8 @@ function $UrlRouterProvider( $locationProvider, $urlMatcherFactory) {
return url;
}

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

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

0 comments on commit 101012e

Please sign in to comment.