Change uniqueDeinflectionsMap to use a real Map
This commit is contained in:
parent
7357eaf07a
commit
c75d04ccb7
@ -290,17 +290,15 @@ class Translator {
|
|||||||
|
|
||||||
const uniqueDeinflectionTerms = [];
|
const uniqueDeinflectionTerms = [];
|
||||||
const uniqueDeinflectionArrays = [];
|
const uniqueDeinflectionArrays = [];
|
||||||
const uniqueDeinflectionsMap = {};
|
const uniqueDeinflectionsMap = new Map();
|
||||||
for (const deinflection of deinflections) {
|
for (const deinflection of deinflections) {
|
||||||
const term = deinflection.term;
|
const term = deinflection.term;
|
||||||
let deinflectionArray;
|
let deinflectionArray = uniqueDeinflectionsMap.get(term);
|
||||||
if (hasOwn(uniqueDeinflectionsMap, term)) {
|
if (typeof deinflectionArray === 'undefined') {
|
||||||
deinflectionArray = uniqueDeinflectionsMap[term];
|
|
||||||
} else {
|
|
||||||
deinflectionArray = [];
|
deinflectionArray = [];
|
||||||
uniqueDeinflectionTerms.push(term);
|
uniqueDeinflectionTerms.push(term);
|
||||||
uniqueDeinflectionArrays.push(deinflectionArray);
|
uniqueDeinflectionArrays.push(deinflectionArray);
|
||||||
uniqueDeinflectionsMap[term] = deinflectionArray;
|
uniqueDeinflectionsMap.set(term, deinflectionArray);
|
||||||
}
|
}
|
||||||
deinflectionArray.push(deinflection);
|
deinflectionArray.push(deinflection);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user