Skip to content

Commit

Permalink
feat: mark ConcurrentHasSet deprecated
Browse files Browse the repository at this point in the history
Signed-off-by: Chen Su <ghosind@gmail.com>
  • Loading branch information
ghosind committed Dec 18, 2024
1 parent e6d0e39 commit 4760859
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions set/concurrent_hashset.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@ import (

// ConcurrentHashSet is a thread-safe set implementation that uses a Golang builtin map to store
// its elements.
//
// Deprecated: Use the SyncSet instead.
type ConcurrentHashSet[T comparable] struct {
data *HashSet[T]

mutex sync.RWMutex
}

// NewConcurrentHashSet creates and returns am empty ConcurrentHashSet with the specified type.
//
// Deprecated: Use the NewSyncSet instead.
func NewConcurrentHashSet[T comparable]() *ConcurrentHashSet[T] {
set := new(ConcurrentHashSet[T])
set.data = NewHashSet[T]()
Expand Down

0 comments on commit 4760859

Please sign in to comment.