diff --git a/chrome/content/zotero/xpcom/data/items.js b/chrome/content/zotero/xpcom/data/items.js index fcdadf58ce..748bafe85f 100644 --- a/chrome/content/zotero/xpcom/data/items.js +++ b/chrome/content/zotero/xpcom/data/items.js @@ -49,6 +49,11 @@ Zotero.Items = new function() { ['firstCreator', 'numNotes', 'numAttachments'] ); } + + // Once primary fields have been cached, get rid of getter for speed purposes + delete this.primaryFields; + this.primaryFields = _primaryFields; + return _primaryFields; }); @@ -685,28 +690,29 @@ Zotero.Items = new function() { if (arguments[0]) { sql += ' AND I.itemID IN (' + Zotero.join(arguments[0], ',') + ')'; } - var itemsRows = Zotero.DB.query(sql); - var itemIDs = []; - for each(var row in itemsRows) { - var itemID = row.itemID; - itemIDs.push(itemID); + var itemsRows = Zotero.DB.query(sql), + itemIDs = {}; + for(var i=0, n=itemsRows.length; i