www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 8d3e25dbfaf98b0726e2b0992c93f0cc7682bc86
parent a4cb8608da2651b386d7c8539ffedbe803991f07
Author: Simon Kornblith <simon@simonster.com>
Date:   Mon, 25 Oct 2010 00:00:29 +0000

kill ZU.min3


Diffstat:
Mchrome/content/zotero/xpcom/utilities.js | 14+-------------
1 file changed, 1 insertion(+), 13 deletions(-)

diff --git 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)); } }