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

Commit 3e82492

Browse files
dimircpetebacondarwin
authored andcommitted
refactor($http): improve readability on conditional assignment
Use ternary operator instead of if statement Closes #5065
1 parent 856be44 commit 3e82492

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/ng/http.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,7 @@ function parseHeaders(headers) {
1717
val = trim(line.substr(i + 1));
1818

1919
if (key) {
20-
if (parsed[key]) {
21-
parsed[key] += ', ' + val;
22-
} else {
23-
parsed[key] = val;
24-
}
20+
parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
2521
}
2622
});
2723

0 commit comments

Comments
 (0)