Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Closed
Prev Previous commit
Next Next commit
refactor($location): remove unnecessary capturing group in RegExp
  • Loading branch information
gkalpak committed Jul 25, 2018
commit 8f28de49265a59f59b5fb6011d1c494564f43a2f
2 changes: 1 addition & 1 deletion src/ng/location.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function stripHash(url) {
}

function trimEmptyHash(url) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove some calls to this within this file now that $browser does it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely!

Note that is many places we trim the empty hash before using the returned url. (If we decide this fix is desired, I will remove those unnecessary calls.)

return url.replace(/(#.+)|#$/, '$1');
return url.replace(/#$/, '');
}


Expand Down