From a8df503907badebe94c602f3aad73b8e7bd46347 Mon Sep 17 00:00:00 2001 From: codefactor-io Date: Sun, 31 Jul 2022 16:20:46 +0000 Subject: [PATCH] [CodeFactor] Apply fixes [ci skip] [skip ci] --- src/util/stringSimilarity.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/stringSimilarity.ts b/src/util/stringSimilarity.ts index 28aa525..83b5b9f 100644 --- a/src/util/stringSimilarity.ts +++ b/src/util/stringSimilarity.ts @@ -5,7 +5,7 @@ export function compareTwoStrings(first: string, second: string) { if (first === second) return 1; // identical or empty if (first.length < 2 || second.length < 2) return 0; // if either is a 0-letter or 1-letter string - let firstBigrams = new Map(); + const firstBigrams = new Map(); for (let i = 0; i < first.length - 1; i++) { const bigram = first.substring(i, i + 2); const count = firstBigrams.has(bigram) @@ -13,7 +13,7 @@ export function compareTwoStrings(first: string, second: string) { : 1; firstBigrams.set(bigram, count); - }; + } let intersectionSize = 0; for (let i = 0; i < second.length - 1; i++) {