Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

refactor($http): simplify buildUrl function #8955

Conversation

pkozlowski-opensource
Copy link
Member

Small refactor to the $http's buildUrl function:

  • avoid double isObject check
  • shaves off few bytes by replacing if statement with a ternary operator

@pkozlowski-opensource pkozlowski-opensource changed the title refactor(): simplify buildUrl function refactor($http): simplify buildUrl function Sep 5, 2014
@caitp
Copy link
Contributor

caitp commented Sep 5, 2014

shaves off few bytes by replacing if statement with a ternary operator

Won't a minifier do that anyways? I think we're doing it this way for readability purposes --- I don't have a big opinion on this one though

@pkozlowski-opensource
Copy link
Member Author

Won't a minifier do that anyways?

I think it will. I guess I just prefer ternary to if but yeh, initially I've just removed the double check for isObject.

@caitp
Copy link
Contributor

caitp commented Sep 5, 2014

I think we should probably keep the explicit if statements and let the minifier deal with it, but otherwise LGTM

@pkozlowski-opensource
Copy link
Member Author

OK, pushed a version with a minimal change for double check.

@caitp
Copy link
Contributor

caitp commented Sep 5, 2014

Looks good =)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants