MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / Less

Method Less

internal/needs/cursor.go:84–101  ·  view source on GitHub ↗

Less reports whether a sorts before b. Both keys come from one sort.

(b Key)

Source from the content-addressed store, hash-verified

82
83// Less reports whether a sorts before b. Both keys come from one sort.
84func (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
103const cursorVersion = 1
104

Callers 2

handleMeNeedsMethod · 0.95
TestCursorFunction · 0.95

Calls 1

BeforeMethod · 0.45

Tested by 1

TestCursorFunction · 0.76