mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Added Length Field in case of NMSlice and support for multiple indexes in template path
This commit is contained in:
committed by
Dan Christian Bogos
parent
5353b95e43
commit
e52e8d7622
@@ -27,7 +27,7 @@ import (
|
||||
// NewOrderedNavigableMap initializates a structure of OrderedNavigableMap with a NavigableMap2
|
||||
func NewOrderedNavigableMap() *OrderedNavigableMap {
|
||||
return &OrderedNavigableMap{
|
||||
nm: NavigableMap2{},
|
||||
nm: NavigableMap{},
|
||||
orderIdx: NewPathItemList(),
|
||||
orderRef: make(map[string][]*PathItemElement),
|
||||
}
|
||||
@@ -109,7 +109,7 @@ func (onm *OrderedNavigableMap) Set(fullPath *FullPath, val NMInterface) (addedN
|
||||
pathItmsSet = make([]PathItems, len(*val.(*NMSlice)))
|
||||
for i := 0; i < val.Len(); i++ {
|
||||
pathItms := fullPath.PathItems.Clone()
|
||||
pathItms[len(pathItms)-1].Index = StringPointer(strconv.Itoa(i))
|
||||
pathItms[len(pathItms)-1].Index = []string{(strconv.Itoa(i))}
|
||||
pathItmsSet[i] = pathItms
|
||||
}
|
||||
} else {
|
||||
@@ -188,7 +188,7 @@ func (onm *OrderedNavigableMap) OrderedFields() (flds []interface{}) {
|
||||
|
||||
// RemoveAll will clean the data and the odrder from OrderedNavigableMap
|
||||
func (onm *OrderedNavigableMap) RemoveAll() {
|
||||
onm.nm = NavigableMap2{}
|
||||
onm.nm = NavigableMap{}
|
||||
onm.orderIdx = NewPathItemList()
|
||||
onm.orderRef = make(map[string][]*PathItemElement)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user