diff --git a/src/github.com/matrix-org/dendrite/roomserver/types/types.go b/src/github.com/matrix-org/dendrite/roomserver/types/types.go index 910ba303f..0c43baf89 100644 --- a/src/github.com/matrix-org/dendrite/roomserver/types/types.go +++ b/src/github.com/matrix-org/dendrite/roomserver/types/types.go @@ -23,6 +23,7 @@ type StateKeyTuple struct { } // 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 { if 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. +// The ordering is arbitrary and is used to implement binary search and to efficiently deduplicate entries. func (a StateEntry) LessThan(b StateEntry) bool { if a.StateKeyTuple != b.StateKeyTuple { return a.StateKeyTuple.LessThan(b.StateKeyTuple)