Skip to content

Commit

Permalink
refactor($http): improve readability on conditional assignment
Browse files Browse the repository at this point in the history
Use ternary operator instead of if statement

Closes angular#5065
  • Loading branch information
dimirc authored and Cameron Knight committed Jul 16, 2014
1 parent 1f2b759 commit 9f12c46
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/ng/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@ function parseHeaders(headers) {
val = trim(line.substr(i + 1));

if (key) {
if (parsed[key]) {
parsed[key] += ', ' + val;
} else {
parsed[key] = val;
}
parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
}
});

Expand Down

0 comments on commit 9f12c46

Please sign in to comment.