diff options
author | ucwong <ethereum2k@gmail.com> | 2022-10-26 09:35:06 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-26 12:35:06 +1100 |
commit | f0e9444c8b25fbe9e0c6f040b8a7493aa1f2501c (patch) | |
tree | 08c45d5953b201ee25fdce8c9c5299e451539f4c /stmutil/containers.go | |
parent | Merge pull request #4 from chrismwendt/generics (diff) | |
download | stm-f0e9444c8b25fbe9e0c6f040b8a7493aa1f2501c.tar.gz stm-f0e9444c8b25fbe9e0c6f040b8a7493aa1f2501c.tar.xz |
missing Get func added (#6)
Diffstat (limited to 'stmutil/containers.go')
-rw-r--r-- | stmutil/containers.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/stmutil/containers.go b/stmutil/containers.go index c7a4a49..2ce05e4 100644 --- a/stmutil/containers.go +++ b/stmutil/containers.go @@ -88,6 +88,10 @@ func (m Map) Set(key, value any) Mappish { return m } +func (m Map) Get(key any) (any, bool) { + return m.Map.Get(key) +} + func (sm Map) Range(f func(key, value any) bool) { iter := sm.Map.Iterator() for !iter.Done() { @@ -112,6 +116,10 @@ func (sm SortedMap) Set(key, value any) Mappish { return sm } +func (sm SortedMap) Get(key any) (any, bool) { + return sm.SortedMap.Get(key) +} + func (sm SortedMap) Delete(key any) Mappish { sm.SortedMap = sm.SortedMap.Delete(key) return sm |