diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2019-10-19 13:32:05 -0400 |
---|---|---|
committer | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2019-10-19 13:32:05 -0400 |
commit | 610c2b9cca953e102aa31449d604d24d2840cce3 (patch) | |
tree | eb1aebc97df9c0843fb72f5085d88cbcb8379d6d /ext/bg/js/database.js | |
parent | 6f5fa6771bac24bb56c137fea6d7387d507aaf39 (diff) |
Move tagCache out of Database and into Translator
Diffstat (limited to 'ext/bg/js/database.js')
-rw-r--r-- | ext/bg/js/database.js | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/ext/bg/js/database.js b/ext/bg/js/database.js index c4d332bf..95466e73 100644 --- a/ext/bg/js/database.js +++ b/ext/bg/js/database.js @@ -20,7 +20,6 @@ class Database { constructor() { this.db = null; - this.tagCache = {}; } async prepare() { @@ -53,7 +52,6 @@ class Database { this.db.close(); await this.db.delete(); this.db = null; - this.tagCache = {}; await this.prepare(); } @@ -180,20 +178,9 @@ class Database { return results; } - findTagForTitleCached(name, title) { - if (this.tagCache.hasOwnProperty(title)) { - const cache = this.tagCache[title]; - if (cache.hasOwnProperty(name)) { - return cache[name]; - } - } - } - async findTagForTitle(name, title) { this.validate(); - const cache = (this.tagCache.hasOwnProperty(title) ? this.tagCache[title] : (this.tagCache[title] = {})); - let result = null; await this.db.tagMeta.where('name').equals(name).each(row => { if (title === row.dictionary) { @@ -201,8 +188,6 @@ class Database { } }); - cache[name] = result; - return result; } |