mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-07 22:37:28 +08:00
refactor($http): improve readability on conditional assignment
Use ternary operator instead of if statement Closes #5065
This commit is contained in:
committed by
Peter Bacon Darwin
parent
8c5cbcba20
commit
64b177377c
@@ -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;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user