Closed Bug 977021 Opened 12 years ago Closed 12 years ago

Cleanup _addSorted::compareStateTime()

Categories

(Tree Management Graveyard :: TBPL, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: emorley, Assigned: emorley)

References

Details

Attachments

(1 file)

y
I found the current code hard to grok when working on bug 958586. The desired sort is as follows: Completed jobs first, then running, then pending. Then failing that, sort by start time. The complication is that 'completed' is really state = {success, failure, usercancel, ...}, and we really want to treat anything that isn't pending or running as the same state (ie: resort to sorting by start time even if state1 != state2, so long as state1 and state2 are both in {success, failure, ...}). With this patch we generalise all states that aren't pending or running, so we can correctly find the completed==completed matches, at the same time as assigning an ID that is in our desired sort order.
Attachment #8382073 - Flags: review?(arpad.borsos)
Attachment #8382073 - Flags: review?(arpad.borsos) → review+
This is really a lot clearer, awesome :-)
Thank you for the quick review :-) remote: https://hg.mozilla.org/webtools/tbpl/rev/b1eb0a1b1c0e (Adding dependency, since this requires the insertion sort fix in that bug in order to work)
Depends on: 958586
Depends on: 980264
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Product: Webtools → Tree Management
Product: Tree Management → Tree Management Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: