Skip to content

Commit

Permalink
Merge pull request hunterhug#154 from honkkki/fix-set
Browse files Browse the repository at this point in the history
Fix set remove item
  • Loading branch information
hunterhug authored Oct 26, 2021
2 parents 5c6778a + ef8c5df commit 1e5bdca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion algorithm/dict.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ func (s *Set) Add(item int) {
// 移除一个元素
func (s *Set) Remove(item int) {
s.Lock()
s.Unlock()
defer s.Unlock()

// 集合没元素直接返回
if s.len == 0 {
Expand Down

0 comments on commit 1e5bdca

Please sign in to comment.