From def6b2091ea0c657eb8a23e8d9106441bcd8191c Mon Sep 17 00:00:00 2001 From: porosnicuadrian Date: Wed, 25 Nov 2020 14:31:44 +0200 Subject: [PATCH] Removed full variable from compressEquals siganture's function --- engine/rateprofile.go | 6 +++--- rates/librates.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/engine/rateprofile.go b/engine/rateprofile.go index 47dc84364..500d41948 100644 --- a/engine/rateprofile.go +++ b/engine/rateprofile.go @@ -232,7 +232,7 @@ func (rIv *RateSInterval) CompressEquals(rIv2 *RateSInterval) (eq bool) { return } for i, rIcr := range rIv.Increments { - if !rIcr.CompressEquals(rIv2.Increments[i], true) { + if !rIcr.CompressEquals(rIv2.Increments[i]) { return } } @@ -250,11 +250,11 @@ func (rIv *RateSInterval) Cost() *decimal.Big { } // CompressEquals compares two RateSIncrement for Compress function -func (rIcr *RateSIncrement) CompressEquals(rIcr2 *RateSIncrement, full bool) (eq bool) { +func (rIcr *RateSIncrement) CompressEquals(rIcr2 *RateSIncrement) (eq bool) { if rIcr.Rate.UID() != rIcr2.Rate.UID() { return } - if full && rIcr.IntervalRateIndex != rIcr2.IntervalRateIndex { + if rIcr.IntervalRateIndex != rIcr2.IntervalRateIndex { return } if rIcr.Usage != rIcr2.Usage { diff --git a/rates/librates.go b/rates/librates.go index 1889d2061..5da4f9913 100644 --- a/rates/librates.go +++ b/rates/librates.go @@ -249,7 +249,7 @@ func computeRateSIntervals(rts []*orderedRate, intervalStart, usage time.Duratio CompressFactor: cmpFactor, Usage: iRtUsage, } - if len(rIcmts) != 0 && rIcrm.CompressEquals(rIcmts[len(rIcmts)-1], false) { + if len(rIcmts) != 0 && rIcrm.CompressEquals(rIcmts[len(rIcmts)-1]) { rIcmts[len(rIcmts)-1].CompressFactor += rIcrm.CompressFactor } else { rIcmts = append(rIcmts, rIcrm)