Files
mautrix-telegram/pkg/gotd/telegram/peers/peerid_map.go
T
2025-06-27 20:03:37 -07:00

27 lines
444 B
Go

package peers
import (
"go.mau.fi/mautrix-telegram/pkg/gotd/constant"
)
type peerIDSet struct {
m map[constant.TDLibPeerID]struct{}
}
func (p *peerIDSet) add(ids ...constant.TDLibPeerID) {
for _, id := range ids {
p.m[id] = struct{}{}
}
}
func (p *peerIDSet) delete(ids ...constant.TDLibPeerID) {
for _, id := range ids {
delete(p.m, id)
}
}
func (p *peerIDSet) has(id constant.TDLibPeerID) bool {
_, ok := p.m[id]
return ok
}