1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00
This commit is contained in:
Jacob Su 2025-02-20 14:29:46 +07:00 committed by GitHub
commit c542fe76e1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 449 additions and 11 deletions

View file

@ -43,3 +43,13 @@ func (m *Map[K, V]) Range(f func(key K, value V) bool) {
func (m *Map[K, V]) Store(key K, value V) {
m.m.Store(key, value)
}
func (m *Map[K, V]) Size() uint32 {
size := uint32(0)
m.m.Range(func(_, _ any) bool {
size++
return true
})
return size
}