From 5eebc6c71ed5752812f415b34f5da12be568d490 Mon Sep 17 00:00:00 2001 From: TeoV Date: Fri, 30 Mar 2018 02:57:08 -0400 Subject: [PATCH] Cast directly interface as float64 --- engine/spls_leastcost.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/engine/spls_leastcost.go b/engine/spls_leastcost.go index 21b0feaaf..17ca6f75e 100644 --- a/engine/spls_leastcost.go +++ b/engine/spls_leastcost.go @@ -41,7 +41,6 @@ func (lcs *LeastCostSorter) SortSuppliers(prflID string, Sorting: lcs.sorting, SortedSuppliers: make([]*SortedSupplier, 0)} for _, s := range suppls { - utils.Logger.Debug(fmt.Sprintf("s : %+v \n", s)) costData, err := lcs.spS.costForEvent(ev, s.AccountIDs, s.RatingPlanIDs) if err != nil { return nil, err @@ -51,12 +50,7 @@ func (lcs *LeastCostSorter) SortSuppliers(prflID string, utils.SupplierS, prflID, s.ID)) continue } - cost, err := utils.IfaceAsFloat64(costData[utils.Cost]) - if err != nil { - return nil, err - } - - if cost > *lcs.spS.maxCost && *lcs.spS.maxCost != 0 { + if costData[utils.Cost].(float64) > *lcs.spS.maxCost && *lcs.spS.maxCost != 0 { continue } srtData := map[string]interface{}{