mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-12 02:26:26 +05:00
Merge branch 'master' of https://github.com/cgrates/cgrates
This commit is contained in:
@@ -43,10 +43,7 @@ func (cs cacheDoubleStore) Append(key string, value interface{}) {
|
||||
} else {
|
||||
elements = make(map[interface{}]struct{})
|
||||
}
|
||||
// check if the val is already present
|
||||
if _, found := elements[value]; !found {
|
||||
elements[value] = struct{}{}
|
||||
}
|
||||
elements[value] = struct{}{}
|
||||
cache.Put(key, elements)
|
||||
}
|
||||
|
||||
@@ -82,8 +79,8 @@ func (cs cacheDoubleStore) DeletePrefix(prefix string) {
|
||||
}
|
||||
|
||||
func (cs cacheDoubleStore) CountEntriesForPrefix(prefix string) int {
|
||||
if _, ok := cs[prefix]; ok {
|
||||
return len(cs[prefix])
|
||||
if m, ok := cs[prefix]; ok {
|
||||
return len(m)
|
||||
}
|
||||
return 0
|
||||
}
|
||||
@@ -135,10 +132,7 @@ func (cs cacheSimpleStore) Append(key string, value interface{}) {
|
||||
} else {
|
||||
elements = make(map[interface{}]struct{})
|
||||
}
|
||||
// check if the val is already present
|
||||
if _, found := elements[value]; !found {
|
||||
elements[value] = struct{}{}
|
||||
}
|
||||
elements[value] = struct{}{}
|
||||
cache.Put(key, elements)
|
||||
}
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ func (rp *RatingProfile) GetRatingPlansForPrefix(cd *CallDescriptor) (err error)
|
||||
for _, p := range utils.SplitPrefix(cd.Destination, MIN_PREFIX_MATCH) {
|
||||
if x, err := cache2go.GetCached(DESTINATION_PREFIX + p); err == nil {
|
||||
destIds := x.(map[interface{}]struct{})
|
||||
for idId, _ := range destIds {
|
||||
for idId := range destIds {
|
||||
dId := idId.(string)
|
||||
if _, ok := rpl.DestinationRates[dId]; ok {
|
||||
rps = rpl.RateIntervalList(dId)
|
||||
|
||||
Reference in New Issue
Block a user