kill ZU.min3
This commit is contained in:
parent
a4cb8608da
commit
8d3e25dbfa
|
@ -297,18 +297,6 @@ Zotero.Utilities.prototype.parseMarkup = function(/**String*/ str) {
|
|||
return parts;
|
||||
}
|
||||
|
||||
Zotero.Utilities.prototype.min3 = function (a, b, c) {
|
||||
var min = a;
|
||||
if (b < min) {
|
||||
min = b;
|
||||
}
|
||||
if (c < min) {
|
||||
min = c;
|
||||
}
|
||||
return min;
|
||||
}
|
||||
|
||||
|
||||
Zotero.Utilities.prototype.levenshtein = function (a, b) {
|
||||
var aLen = a.length;
|
||||
var bLen = b.length;
|
||||
|
@ -328,7 +316,7 @@ Zotero.Utilities.prototype.levenshtein = function (a, b) {
|
|||
for (i = 1; i <= aLen; i++) {
|
||||
for (j = 1; j <= bLen; j++) {
|
||||
cost = (a[i-1] == b[j-1]) ? 0 : 1;
|
||||
arr[i][j] = this.min3(arr[i-1][j] + 1, arr[i][j-1] + 1, arr[i-1][j-1] + cost);
|
||||
arr[i][j] = Math.min(arr[i-1][j] + 1, Math.min(arr[i][j-1] + 1, arr[i-1][j-1] + cost));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user