Global code ovehaul - remove CAS and other, add 15 minute greet check
- Remove CAS, as it no longer works for us - Remove other checks - Implement 15 minute greet timeout check - Fix chat logos - Ditch thirdparty logger, use stdlib log facility wrapper for logging
This commit is contained in:
26
vendor/github.com/NicoNex/echotron/v3/smap.go
generated
vendored
Normal file
26
vendor/github.com/NicoNex/echotron/v3/smap.go
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
package echotron
|
||||
|
||||
import "sync"
|
||||
|
||||
type smap[K comparable, V any] sync.Map
|
||||
|
||||
func (s *smap[K, V]) load(key K) (val V, ok bool) {
|
||||
v, ok := (*sync.Map)(s).Load(key)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
return v.(V), ok
|
||||
}
|
||||
|
||||
func (s *smap[K, V]) store(key K, val V) {
|
||||
(*sync.Map)(s).Store(key, val)
|
||||
}
|
||||
|
||||
func (s *smap[K, V]) loadOrStore(key K, val V) (actual V, loaded bool) {
|
||||
a, loaded := (*sync.Map)(s).LoadOrStore(key, val)
|
||||
return a.(V), loaded
|
||||
}
|
||||
|
||||
func (s *smap[K, V]) delete(key K) {
|
||||
(*sync.Map)(s).Delete(key)
|
||||
}
|
||||
Reference in New Issue
Block a user