Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ func (c Collection) Len() int {
// Less is needed for the sort interface to compare two Version objects on the
// slice. If checks if one is less than the other.
func (c Collection) Less(i, j int) bool {
return c[i].LessThan(c[j])
comp := c[i].Compare(c[j])
if comp != 0 {
return comp < 0
}
return c[i].Original() < c[j].Original()
}

// Swap is needed for the sort interface to replace the Version objects
Expand Down