Prepare occurrence chronology keys before sorting
This commit is contained in:
@@ -35,6 +35,12 @@ func Less(order shared.SourceRefOrder, left, right dnd.NPCOccurrence) bool {
|
||||
if leftHasEvidence && leftPosition != rightPosition {
|
||||
return leftPosition < rightPosition
|
||||
}
|
||||
return LessAfterEvidence(order, left, right)
|
||||
}
|
||||
|
||||
// LessAfterEvidence compares tie breakers after equal earliest-evidence keys.
|
||||
// Callers must establish that premise; Less remains suitable for arbitrary input.
|
||||
func LessAfterEvidence(order shared.SourceRefOrder, left, right dnd.NPCOccurrence) bool {
|
||||
leftKey := left.NPCID
|
||||
rightKey := right.NPCID
|
||||
if leftKey != rightKey {
|
||||
|
||||
Reference in New Issue
Block a user