mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-02 07:05:24 +00:00
Bug 426806 - 'Sort By Name' is slow. r=dietrich.
This commit is contained in:
parent
43b7526969
commit
9ca892e70f
@ -897,14 +897,26 @@ placesSortFolderByNameTransactions.prototype = {
|
||||
newOrder = newOrder.concat(preSep);
|
||||
}
|
||||
|
||||
// set the nex indexs
|
||||
for (var i = 0; i < count; ++i)
|
||||
// set the nex indexes
|
||||
var callback = {
|
||||
runBatched: function() {
|
||||
for (var i = 0; i < newOrder.length; ++i) {
|
||||
PlacesUtils.bookmarks.setItemIndex(newOrder[i].itemId, i);
|
||||
}
|
||||
}
|
||||
};
|
||||
PlacesUtils.bookmarks.runInBatchMode(callback, null);
|
||||
},
|
||||
|
||||
undoTransaction: function PSSFBN_undoTransaction() {
|
||||
for (item in this._oldOrder)
|
||||
PlacesUtils.bookmarks.setItemIndex(item, this._oldOrder[item]);
|
||||
var callback = {
|
||||
_self: this,
|
||||
runBatched: function() {
|
||||
for (item in this._self._oldOrder)
|
||||
PlacesUtils.bookmarks.setItemIndex(item, this._self._oldOrder[item]);
|
||||
}
|
||||
};
|
||||
PlacesUtils.bookmarks.runInBatchMode(callback, null);
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user