operator at for dict

This commit is contained in:
2026-07-14 06:50:56 +02:00
parent bf2c7df0f0
commit 8c55f4ac4b
3 changed files with 38 additions and 5 deletions
+11
View File
@@ -160,6 +160,17 @@ func (dict *DictType) GetItem(key any) (value any, exists bool) {
return
}
func (dict *DictType) FindKey(item any) (key any, exists bool) {
for k, v := range *dict {
if kern.Equal(v, item) {
key = k
exists = true
break
}
}
return
}
func (dict *DictType) Clone() kern.Cloner {
c := newDict(nil)
for k, v := range *dict {