commit 35eb1292a5b879a178751c3cee09b6dccf8de868
parent b495bb633455acc9755aec171f27b1a45910b816
Author: Dan Stillman <dstillman@zotero.org>
Date: Thu, 29 Jun 2006 07:03:24 +0000
Changed getRandomID() to use the full SQLite three-byte range if unable to find a two-byte id in 3 tries
Diffstat:
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
@@ -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);