Skip to content

Commit

Permalink
types/logid: add a Compare method
Browse files Browse the repository at this point in the history
Updates #cleanup

Signed-off-by: David Anderson <[email protected]>
  • Loading branch information
danderson committed Jul 28, 2023
1 parent 52212f4 commit 6114247
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion types/logid/id.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ func (id PublicID) String() string {
}

func (id1 PublicID) Less(id2 PublicID) bool {
return slices.Compare(id1[:], id2[:]) < 0
return id1.Compare(id2) < 0
}

func (id1 PublicID) Compare(id2 PublicID) int {
return slices.Compare(id1[:], id2[:])
}

func (id PublicID) IsZero() bool {
Expand Down

0 comments on commit 6114247

Please sign in to comment.