From 64b177377c2aa8ae97c6f8752b69424d70a4fb4e Mon Sep 17 00:00:00 2001 From: Wladimir Coka Date: Thu, 21 Nov 2013 16:35:47 -0500 Subject: [PATCH] refactor($http): improve readability on conditional assignment Use ternary operator instead of if statement Closes #5065 --- src/ng/http.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/ng/http.js b/src/ng/http.js index 88dda8e3..96a36b5d 100644 --- a/src/ng/http.js +++ b/src/ng/http.js @@ -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; } });