diff options
author | José Bollo <jose.bollo@iot.bzh> | 2016-02-10 09:28:00 +0100 |
---|---|---|
committer | José Bollo <jose.bollo@iot.bzh> | 2016-02-10 09:28:00 +0100 |
commit | d663533aad6585b33f4fe3138ae6ed9e0b520e78 (patch) | |
tree | c5b3a7d5d50d7945a714af2db8fe0a577ef7cd18 /afm-client/app | |
parent | 3ba47d47a99984a1418ddf758d004e5e530f2195 (diff) |
app.js: avoid ambiguity
Writing: "conf ? expr : var = item;" is wrong
because = has lower priority than ?:.
It is in fact evaluated as: "(conf ? expr : var) = item;"
Change-Id: I876b67b80c9285356d82bcc1c87795a97a501c86
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'afm-client/app')
-rw-r--r-- | afm-client/app/Frontend/app.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/afm-client/app/Frontend/app.js b/afm-client/app/Frontend/app.js index 24d5539..d332894 100644 --- a/afm-client/app/Frontend/app.js +++ b/afm-client/app/Frontend/app.js @@ -6,7 +6,7 @@ location.search.substr(1).split("&").forEach(function(item) { var k = item.split("=")[0]; var v = decodeURIComponent(item.split("=")[1]); - (k in qd) ? qd[k].push(v) : qd[k] = [v]; + if (k in qd) qd[k].push(v); else qd[k] = [v]; }); return qd; } |