Skip to content

Commit 0c06111

Browse files
committed
chore: Add todo for optimize code
1 parent f3579bd commit 0c06111

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

hashset.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
)
77

88
// Set represents a thread-safe collection of unique elements.
9+
910
type Set struct {
1011
mu sync.RWMutex // Guards access to the internal hash map.
1112
hash map[interface{}]bool // Stores elements as keys with a boolean value.
@@ -20,6 +21,7 @@ func New(initialValue ...interface{}) *Set {
2021
v := reflect.ValueOf(iv)
2122
if v.Kind() == reflect.Slice {
2223
for i := 0; i < v.Len(); i++ {
24+
// TODO: Optimize destructuring slice
2325
s.Add(v.Index(i).Interface())
2426
}
2527
} else {

0 commit comments

Comments
 (0)