1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-15 00:15:32 +02:00

more generics

This commit is contained in:
Jesse Duffield
2022-03-19 16:34:46 +11:00
parent eda8f4a5d4
commit bf4f06ab4e
21 changed files with 303 additions and 198 deletions

View File

@ -19,13 +19,9 @@ func NewFromSlice[T comparable](slice []T) *Set[T] {
return &Set[T]{hashMap: hashMap}
}
func (s *Set[T]) Add(value T) {
s.hashMap[value] = true
}
func (s *Set[T]) AddSlice(slice []T) {
for _, value := range slice {
s.Add(value)
func (s *Set[T]) Add(values ...T) {
for _, value := range values {
s.hashMap[value] = true
}
}