From: Laurent Mazet Date: Wed, 10 Jun 2020 21:01:37 +0000 (+0200) Subject: cleaner static variable in downloadDictionary function X-Git-Url: https://secure.softndesign.org/git/?a=commitdiff_plain;h=34dac8a41413fd30077681f9ba58005bb018022f;p=trivabble.git cleaner static variable in downloadDictionary function --- diff --git a/public/trivabble.js b/public/trivabble.js index d84a5ba..37f9a5f 100644 --- a/public/trivabble.js +++ b/public/trivabble.js @@ -151,9 +151,8 @@ } function downloadDictionary(code) { - if (typeof downloadDictionary.code === "undefined") { - downloadDictionary.code = ""; - } else if (downloadDictionary.code === code) { + /* static variable */ + if (downloadDictionary.code === code) { return; } downloadDictionary.code = code; @@ -172,7 +171,6 @@ } }; file.send(null); - return; } function removeElem(elem) {