MCPcopy Create free account
hub / github.com/daodst/chat / LessThan

Method LessThan

roomserver/types/types.go:149–154  ·  view source on GitHub ↗

LessThan returns true if this state entry is less than the other state entry. The ordering is arbitrary and is used to implement binary search and to efficiently deduplicate entries.

(b StateEntry)

Source from the content-addressed store, hash-verified

147// LessThan returns true if this state entry is less than the other state entry.
148// The ordering is arbitrary and is used to implement binary search and to efficiently deduplicate entries.
149func (a StateEntry) LessThan(b StateEntry) bool {
150 if a.StateKeyTuple != b.StateKeyTuple {
151 return a.StateKeyTuple.LessThan(b.StateKeyTuple)
152 }
153 return a.EventNID < b.EventNID
154}
155
156// Deduplicate takes a set of state entries and ensures that there are no
157// duplicate (event type, state key) tuples. If there are then we dedupe

Callers 10

LessMethod · 0.45
containsMethod · 0.45
DeduplicateStateEntriesFunction · 0.45
LessMethod · 0.45
LessMethod · 0.45
lookupMethod · 0.45
LessMethod · 0.45
lookupMethod · 0.45
calculateVersionsFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected