mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Replace if else with shared variable
This commit is contained in:
committed by
Dan Christian Bogos
parent
cf0656fd12
commit
c726b1f5cc
@@ -339,6 +339,7 @@ func (tpr *TpReader) LoadRatingProfilesFiltered(qriedRpf *utils.TPRatingProfile)
|
||||
return err
|
||||
}
|
||||
for _, tpRpf := range rpfs {
|
||||
resultRatingProfile = &RatingProfile{Id: tpRpf.KeyId()}
|
||||
if tpr.dm.dataDB != nil { // check if we have a connection with dataDB and check if RatingProfile exists
|
||||
if resultRatingProfile, err = tpr.dm.GetRatingProfile(tpRpf.KeyId(), false, utils.NonTransactional); err != nil {
|
||||
if err == utils.ErrNotFound {
|
||||
@@ -348,8 +349,6 @@ func (tpr *TpReader) LoadRatingProfilesFiltered(qriedRpf *utils.TPRatingProfile)
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
resultRatingProfile = &RatingProfile{Id: tpRpf.KeyId()}
|
||||
}
|
||||
|
||||
for _, tpRa := range tpRpf.RatingPlanActivations {
|
||||
|
||||
Reference in New Issue
Block a user