Inline and simplify JS

This commit is contained in:
Florine W. Dekker 2019-06-13 19:47:37 +02:00
parent 726f32c4dd
commit 7ca7f6b506
Signed by: FWDekker
GPG Key ID: B1B567AF58D6EE0F
3 changed files with 166 additions and 188 deletions

File diff suppressed because one or more lines are too long

View File

@ -71,9 +71,8 @@ const jaro_winkler = function (a, b, options) {
}
// Short-circuit if not matches found
if (m === 0) {
if (m === 0)
return 0;
}
// Count transpositions
let k = 0;
@ -81,7 +80,8 @@ const jaro_winkler = function (a, b, options) {
for (let i = 0; i < aLen; i++) {
if (aMatches[i] === true) {
for (let j = k; j < bLen; j++) {
let j;
for (j = k; j < bLen; j++) {
if (bMatches[j] === true) {
k = j + 1;
break;

File diff suppressed because one or more lines are too long