mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
Bug 307137 Performance regression fix. Only compute now() once per sort. r=mvl
This commit is contained in:
parent
d04eef285b
commit
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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user