1 Star 0 Fork 0

sqos / beats

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
hashset.go 480 Bytes
一键复制 编辑 原始数据 按行查看 历史
Andrew Kroh 提交于 2016-12-22 18:51 . Add system socket MetricSet
package socket
// hashSet is a simple set built upon a map.
type hashSet map[uint64]struct{}
// Add adds a value to the set.
func (s hashSet) Add(hash uint64) {
s[hash] = struct{}{}
}
// Contains return true if the value is in the set.
func (s hashSet) Contains(hash uint64) bool {
_, exists := s[hash]
return exists
}
// Reset resets the contents of the set to empty and returns itself.
func (s hashSet) Reset() hashSet {
for k := range s {
delete(s, k)
}
return s
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/sqos/beats.git
git@gitee.com:sqos/beats.git
sqos
beats
beats
v6.0.0-beta1

搜索帮助

344bd9b3 5694891 D2dac590 5694891