Bug 426806 - "Sort by Name" is slow in Places. r=dietrich.

This commit is contained in:
Asaf Romano 2008-07-22 03:10:59 +03:00
Родитель ce90fb3c24
Коммит 49dd1a22db
1 изменённых файлов: 16 добавлений и 5 удалений

Просмотреть файл

@ -897,14 +897,25 @@ placesSortFolderByNameTransactions.prototype = {
newOrder = newOrder.concat(preSep);
}
// set the nex indexs
for (var i = 0; i < count; ++i)
PlacesUtils.bookmarks.setItemIndex(newOrder[i].itemId, i);
// set the nex indexes
var callback = {
runBatched: function(aUserData) {
for (var i = 0; i < newOrder.length; ++i) {
PlacesUtils.bookmarks.setItemIndex(newOrder[i].itemId, i);
}
}
};
PlacesUtils.bookmarks.runInBatchMode(callback, newOrder);
},
undoTransaction: function PSSFBN_undoTransaction() {
for (item in this._oldOrder)
PlacesUtils.bookmarks.setItemIndex(item, this._oldOrder[item]);
var callback = {
runBatched: function(aUserData) {
for (item in oldOrder)
PlacesUtils.bookmarks.setItemIndex(item, oldOrder[item]);
}
};
PlacesUtils.bookmarks.runInBatchMode(callback, this._oldOrder);
}
};