From 35eb1292a5b879a178751c3cee09b6dccf8de868 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 29 Jun 2006 07:03:24 +0000 Subject: [PATCH] Changed getRandomID() to use the full SQLite three-byte range if unable to find a two-byte id in 3 tries --- chrome/chromeFiles/content/scholar/xpcom/scholar.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chrome/chromeFiles/content/scholar/xpcom/scholar.js b/chrome/chromeFiles/content/scholar/xpcom/scholar.js index 5f4102c6a..84d12b255 100644 --- a/chrome/chromeFiles/content/scholar/xpcom/scholar.js +++ b/chrome/chromeFiles/content/scholar/xpcom/scholar.js @@ -272,11 +272,11 @@ var Scholar = new function(){ max = 16383; } - var tries = 10; // # of tries to find a unique id + var tries = 3; // # of tries to find a unique id do { // If no luck after number of tries, try a larger range if (!tries){ - max = max * 2; + max = max * 128; } var rnd = Math.floor(Math.random()*max); var exists = Scholar.DB.valueQuery(sql + rnd);