dict-type.go: exported NewDataCursor

This commit is contained in:
Celestino Amoroso 2024-07-18 07:25:51 +02:00
parent be25385d02
commit 7745dc24e2

View File

@ -18,7 +18,22 @@ func MakeDict() (dict *DictType) {
return
}
func NewDict(dictAny map[any]any) (dict *DictType) {
var d DictType
if dictAny != nil {
d = make(DictType, len(dictAny))
for i, item := range dictAny {
d[i] = item
}
} else {
d = make(DictType)
}
dict = &d
return
}
func newDict(dictAny map[any]*term) (dict *DictType) {
// TODO Change wi a call to NewDict()
var d DictType
if dictAny != nil {
d = make(DictType, len(dictAny))