From a17e8445cb3bf61fd9db63d71b00085ba4fe9a2f Mon Sep 17 00:00:00 2001 From: Radu Ioan Fericean Date: Tue, 4 Aug 2015 19:39:38 +0300 Subject: [PATCH] better getlcr paginator --- engine/calldesc.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/calldesc.go b/engine/calldesc.go index 8b38da817..ba5e7c130 100644 --- a/engine/calldesc.go +++ b/engine/calldesc.go @@ -1112,10 +1112,10 @@ func (cd *CallDescriptor) GetLCR(stats StatsInterface, p *utils.Paginator) (*LCR lcrCost.Sort() } if p != nil { - if p.Offset != nil && *p.Offset > 0 && *p.Offset < len(lcrCost.SupplierCosts)-1 { + if p.Offset != nil && *p.Offset > 0 && *p.Offset < len(lcrCost.SupplierCosts) { lcrCost.SupplierCosts = lcrCost.SupplierCosts[*p.Offset:] } - if p.Limit != nil && *p.Limit > 0 && *p.Limit < len(lcrCost.SupplierCosts)-1 { + if p.Limit != nil && *p.Limit > 0 && *p.Limit < len(lcrCost.SupplierCosts) { lcrCost.SupplierCosts = lcrCost.SupplierCosts[:*p.Limit] } }