Slightly improve the refund by not compressing timespans anymore

This commit is contained in:
DanB
2016-09-16 17:29:58 +02:00
parent 7f92a4090e
commit 30d6603967

View File

@@ -140,9 +140,9 @@ func (self *SMGSession) debit(dur time.Duration, lastUsed *time.Duration) (time.
// Attempts to refund a duration, error on failure
func (self *SMGSession) refund(refundDuration time.Duration) error {
//fmt.Printf("Refunding duration: %+v\n", refundDuration)
firstCC := self.callCosts[0] // use merged cc (from close function)
firstCC.Timespans.Decompress()
defer firstCC.Timespans.Compress()
var refundIncrements engine.Increments
for i := len(firstCC.Timespans) - 1; i >= 0; i-- {
ts := firstCC.Timespans[i]