From a74b83e3f275e44f686066081c7fdb665180ff9e Mon Sep 17 00:00:00 2001 From: Oskar Haarklou Veileborg Date: Thu, 12 Jan 2023 10:22:46 +0100 Subject: sets & maps: remove varargs APIs & SetMany variants The implementation behind the API is not more efficient than manually looping over a data structure and inserting elements one-by-one. --- sets_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'sets_test.go') diff --git a/sets_test.go b/sets_test.go index 5a83eb9..ca3aa3d 100644 --- a/sets_test.go +++ b/sets_test.go @@ -6,8 +6,8 @@ import ( func TestSetsPut(t *testing.T) { s := NewSet[string](nil) - s2 := s.Set("1").Set("1") - s2.Set("2") + s2 := s.Add("1").Add("1") + s2.Add("2") if s.Len() != 0 { t.Fatalf("Unexpected mutation of set") } @@ -34,7 +34,7 @@ func TestSetsPut(t *testing.T) { func TestSetsDelete(t *testing.T) { s := NewSet[string](nil) - s2 := s.Set("1") + s2 := s.Add("1") s3 := s.Delete("1") if s2.Len() != 1 { t.Fatalf("Unexpected non-mutation of set") @@ -52,7 +52,7 @@ func TestSetsDelete(t *testing.T) { func TestSortedSetsPut(t *testing.T) { s := NewSortedSet[string](nil) - s2 := s.Set("1").Set("1").Set("0") + s2 := s.Add("1").Add("1").Add("0") if s.Len() != 0 { t.Fatalf("Unexpected mutation of set") } @@ -86,7 +86,7 @@ func TestSortedSetsPut(t *testing.T) { func TestSortedSetsDelete(t *testing.T) { s := NewSortedSet[string](nil) - s2 := s.Set("1") + s2 := s.Add("1") s3 := s.Delete("1") if s2.Len() != 1 { t.Fatalf("Unexpected non-mutation of set") -- cgit v1.2.3