From c726b1f5cc5dd2c47abb367cf1bd0674ad33bdd4 Mon Sep 17 00:00:00 2001 From: TeoV Date: Fri, 21 Aug 2020 10:28:52 +0300 Subject: [PATCH] Replace if else with shared variable --- engine/tpreader.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/engine/tpreader.go b/engine/tpreader.go index 2fb87b8d4..aa4ae7075 100644 --- a/engine/tpreader.go +++ b/engine/tpreader.go @@ -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 {