refactor($http): improve readability on conditional assignment

Use ternary operator instead of if statement

Closes #5065
This commit is contained in:
Wladimir Coka
2013-11-21 16:35:47 -05:00
committed by Peter Bacon Darwin
parent 8c5cbcba20
commit 64b177377c

View File

@@ -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;
}
});