Fix incorrect index being used for headword removal (#1933)

This commit is contained in:
toasted-nutbread 2021-09-05 21:07:23 -04:00 committed by GitHub
parent 97a80276f6
commit b988417031
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -535,7 +535,7 @@ class Translator {
const indexRemap = new Map(); const indexRemap = new Map();
let oldIndex = 0; let oldIndex = 0;
for (let i = 0, ii = headwords.length; i < ii; ++i) { for (let i = 0, ii = headwords.length; i < ii; ++i) {
if (removeHeadwordIndices.has(i)) { if (removeHeadwordIndices.has(oldIndex)) {
headwords.splice(i, 1); headwords.splice(i, 1);
--i; --i;
--ii; --ii;