зеркало из https://github.com/mozilla/gecko-dev.git
Bug 307137 Performance regression fix. Only compute now() once per sort. r=mvl
This commit is contained in:
Родитель
d04eef285b
Коммит
61bb44ed0b
|
@ -386,7 +386,7 @@ var toDoTreeView =
|
|||
}
|
||||
element.setAttribute("sortActive", sortActive);
|
||||
element.setAttribute("sortDirection", this.sortDirection);
|
||||
this.sortStartedTime = new Date().getTime(); // for null dates during sort
|
||||
this.sortStartedTime = now(); // for null dates during sort
|
||||
gTaskArray.sort( compareTasks );
|
||||
|
||||
document.getElementById( ToDoUnifinderTreeName ).view = this;
|
||||
|
@ -499,9 +499,9 @@ function compareNumber(a, b) {
|
|||
// Takes two calDateTimes
|
||||
function compareDate(a, b) {
|
||||
if (!a)
|
||||
a = now();
|
||||
a = toDoTreeView.sortStartedTime;
|
||||
if (!b)
|
||||
b = now();
|
||||
b = toDoTreeView.sortStartedTime;
|
||||
return (a.compare(b));
|
||||
}
|
||||
|
||||
|
@ -547,7 +547,7 @@ function refreshToDoTree( taskArray )
|
|||
{
|
||||
toDoTreeView.selectedColumn = ArrayOfTreeCols[i].getAttribute( "id" );
|
||||
toDoTreeView.sortDirection = ArrayOfTreeCols[i].getAttribute("sortDirection");
|
||||
toDoTreeView.sortStartedTime = new Date().getTime(); //for null/0 dates
|
||||
toDoTreeView.sortStartedTime = now(); //for null/0 dates
|
||||
gTaskArray.sort(compareTasks);
|
||||
break;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче