Removed full variable from compressEquals siganture's function

This commit is contained in:
porosnicuadrian
2020-11-25 14:31:44 +02:00
committed by Dan Christian Bogos
parent 08a8fedd5f
commit def6b2091e
2 changed files with 4 additions and 4 deletions

View File

@@ -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 {

View File

@@ -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)