mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-07 15:03:09 -06:00
Explain that the arbitrary ordering is arbitrary
This commit is contained in:
parent
00ca811537
commit
01632989ac
|
|
@ -23,6 +23,7 @@ type StateKeyTuple struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// LessThan returns true if this state key is less than the other state key.
|
// LessThan returns true if this state key is less than the other state key.
|
||||||
|
// The ordering is arbitrary and is used to implement binary search and to efficiently deduplicate entries.
|
||||||
func (a StateKeyTuple) LessThan(b StateKeyTuple) bool {
|
func (a StateKeyTuple) LessThan(b StateKeyTuple) bool {
|
||||||
if a.EventTypeNID != b.EventTypeNID {
|
if a.EventTypeNID != b.EventTypeNID {
|
||||||
return a.EventTypeNID < b.EventTypeNID
|
return a.EventTypeNID < b.EventTypeNID
|
||||||
|
|
@ -38,6 +39,7 @@ type StateEntry struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// LessThan returns true if this state entry is less than the other state entry.
|
// 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.
|
||||||
func (a StateEntry) LessThan(b StateEntry) bool {
|
func (a StateEntry) LessThan(b StateEntry) bool {
|
||||||
if a.StateKeyTuple != b.StateKeyTuple {
|
if a.StateKeyTuple != b.StateKeyTuple {
|
||||||
return a.StateKeyTuple.LessThan(b.StateKeyTuple)
|
return a.StateKeyTuple.LessThan(b.StateKeyTuple)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue