mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-08 04:53:42 +00:00
all: clean up code with Go 1.24+ in mind (#5489)
* all: clean up code with Go 1.24+ in mind * all: more old go cleanup * all: even remove rand_fastrand64 * runtime: revert rand changes * runtime: re-drop rand_fastrand64
This commit is contained in:
@@ -71,6 +71,12 @@ func (m *Map) Range(f func(key, value interface{}) bool) {
|
||||
}
|
||||
}
|
||||
|
||||
func (m *Map) Clear() {
|
||||
m.lock.Lock()
|
||||
defer m.lock.Unlock()
|
||||
clear(m.m)
|
||||
}
|
||||
|
||||
// Swap replaces the value for the given key, and returns the old value if any.
|
||||
func (m *Map) Swap(key, value any) (previous any, loaded bool) {
|
||||
m.lock.Lock()
|
||||
|
||||
Reference in New Issue
Block a user