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
856be44628
commit
3e82492fc6
+1
-5
@@ -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