Skip to content

Commit

Permalink
fix the issues from codebeat
Browse files Browse the repository at this point in the history
  • Loading branch information
tamada committed Mar 23, 2021
1 parent c13de3d commit 5644bae
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions order.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ func min(a, b int) int {
func (order *Order) Compare(other *Order) int {
orders := order.toSlice()
others := other.toSlice()
return compare(orders, others)
}

func compare(orders, others []*Order) int {
loop := min(len(orders), len(others))
for i := 0; i < loop; i++ {
if orders[i].index < others[i].index {
Expand Down

0 comments on commit 5644bae

Please sign in to comment.