From 9d4b75de20d4a734d3f260498cb50b4e20ae8310 Mon Sep 17 00:00:00 2001 From: siikamiika Date: Thu, 19 Oct 2017 00:47:08 +0300 Subject: fix error in utilStringHashCode --- ext/bg/js/options.js | 2 +- ext/bg/js/util.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/bg/js/options.js b/ext/bg/js/options.js index 00981096..5902bc30 100644 --- a/ext/bg/js/options.js +++ b/ext/bg/js/options.js @@ -269,7 +269,7 @@ function optionsVersion(options) { } options.general.compactTags = false; options.general.compactGlossaries = false; - if (utilStringHashCode(options.anki.fieldTemplates) !== -1895236672) { // a3c8508031a1073629803d0616a2ee416cd3cccc + if (utilStringHashCode(options.anki.fieldTemplates) !== -805327496) { // a3c8508031a1073629803d0616a2ee416cd3cccc options.anki.fieldTemplates = '{{#if merge}}\n' + optionsFieldTemplates() + '\n{{else}}\n' + diff --git a/ext/bg/js/util.js b/ext/bg/js/util.js index 88d96688..91b16e79 100644 --- a/ext/bg/js/util.js +++ b/ext/bg/js/util.js @@ -59,7 +59,7 @@ function utilStringHashCode(string) { return hashCode; } - for (let i = 0, charCode = string.charCodeAt(i); i < string.length; i++) { + for (let i = 0, charCode = string.charCodeAt(i); i < string.length; charCode = string.charCodeAt(++i)) { hashCode = ((hashCode << 5) - hashCode) + charCode; hashCode |= 0; } -- cgit v1.2.3