File tree Expand file tree Collapse file tree 1 file changed +3
-16
lines changed
services/horizon/internal/actions Expand file tree Collapse file tree 1 file changed +3
-16
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package actions
22
33import (
44 "net/http"
5+ "slices"
56
67 protocol "github.com/stellar/go/protocols/horizon"
78 "github.com/stellar/go/services/horizon/internal/context"
@@ -23,20 +24,6 @@ type OrderBookResponse struct {
2324 protocol.OrderBookSummary
2425}
2526
26- func priceLevelsEqual (a , b []protocol.PriceLevel ) bool {
27- if len (a ) != len (b ) {
28- return false
29- }
30-
31- for i := range a {
32- if a [i ] != b [i ] {
33- return false
34- }
35- }
36-
37- return true
38- }
39-
4027// Equals returns true if the OrderBookResponse is equal to `other`
4128func (o OrderBookResponse ) Equals (other StreamableObjectResponse ) bool {
4229 otherOrderBook , ok := other .(OrderBookResponse )
@@ -45,8 +32,8 @@ func (o OrderBookResponse) Equals(other StreamableObjectResponse) bool {
4532 }
4633 return otherOrderBook .Selling == o .Selling &&
4734 otherOrderBook .Buying == o .Buying &&
48- priceLevelsEqual (otherOrderBook .Bids , o .Bids ) &&
49- priceLevelsEqual (otherOrderBook .Asks , o .Asks )
35+ slices . Equal (otherOrderBook .Bids , o .Bids ) &&
36+ slices . Equal (otherOrderBook .Asks , o .Asks )
5037}
5138
5239var invalidOrderBook = problem.P {
You can’t perform that action at this time.
0 commit comments