Less reports whether a sorts before b. Both keys come from one sort.
(b Key)
| 82 | |
| 83 | // Less reports whether a sorts before b. Both keys come from one sort. |
| 84 | func (a Key) Less(b Key) bool { |
| 85 | if a.Sort == SortImportance || a.Sort == SortSimplicity { |
| 86 | if a.Primary != b.Primary { |
| 87 | return a.Primary > b.Primary |
| 88 | } |
| 89 | if a.Secondary != b.Secondary { |
| 90 | return a.Secondary > b.Secondary |
| 91 | } |
| 92 | return a.ItemID < b.ItemID |
| 93 | } |
| 94 | if !a.Waiting.Equal(b.Waiting) { |
| 95 | return a.Waiting.Before(b.Waiting) |
| 96 | } |
| 97 | if !a.Created.Equal(b.Created) { |
| 98 | return a.Created.Before(b.Created) |
| 99 | } |
| 100 | return a.ItemID < b.ItemID |
| 101 | } |
| 102 | |
| 103 | const cursorVersion = 1 |
| 104 |