mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-15 21:29:52 +05:00
Add switch instead of if
This commit is contained in:
committed by
Dan Christian Bogos
parent
6538483e55
commit
55bcc28169
@@ -100,7 +100,8 @@ func (sSpls *SortedSuppliers) SortQOS(params []string) {
|
||||
if sSpls.SortedSuppliers[i].worstStats[param] == sSpls.SortedSuppliers[j].worstStats[param] {
|
||||
continue
|
||||
}
|
||||
if sSpls.SortedSuppliers[i].worstStats[param] == -1 {
|
||||
if (param != utils.MetaPDD && sSpls.SortedSuppliers[i].worstStats[param] == -1) ||
|
||||
(param == utils.MetaPDD && sSpls.SortedSuppliers[i].worstStats[param] == 1000000) {
|
||||
return false
|
||||
}
|
||||
switch param {
|
||||
|
||||
@@ -68,9 +68,11 @@ func (lcs *QOSSupplierSorter) SortSuppliers(prflID string, suppls []*Supplier,
|
||||
}
|
||||
}
|
||||
}
|
||||
if hasMetric == false { //if not have populate with default value
|
||||
srtData[metric] = -1
|
||||
if metric == utils.MetaPDD {
|
||||
if !hasMetric { //if not have populate with default value
|
||||
switch metric {
|
||||
default:
|
||||
srtData[metric] = -1
|
||||
case utils.MetaPDD:
|
||||
srtData[metric] = 1000000
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user