mirror of
https://gitee.com/johng/gf
synced 2026-07-08 22:40:30 +08:00
并发安全容器新增LockFunc/RLockFunc方法,完善Iterator遍历方法注释
This commit is contained in:
@ -21,7 +21,7 @@ func NewStringSet() *StringSet {
|
||||
return &StringSet{m: make(map[string]struct{})}
|
||||
}
|
||||
|
||||
// 给定回调函数对原始内容进行遍历
|
||||
// 给定回调函数对原始内容进行遍历,回调函数返回true表示继续遍历,否则停止遍历
|
||||
func (this *StringSet) Iterator(f func (v string) bool) {
|
||||
this.mu.RLock()
|
||||
for k, _ := range this.m {
|
||||
|
||||
Reference in New Issue
Block a user