diff --git a/chrome/content/zotero/xpcom/utilities.js b/chrome/content/zotero/xpcom/utilities.js index aeddfe4ff..f470c27a0 100644 --- a/chrome/content/zotero/xpcom/utilities.js +++ b/chrome/content/zotero/xpcom/utilities.js @@ -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)); } }