Skip to content

Commit

Permalink
internal/xsync changes
Browse files Browse the repository at this point in the history
  • Loading branch information
asmyasnikov committed Sep 6, 2024
1 parent cd58c33 commit 0b61046
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/xsync/map.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (m *Map[K, V]) Delete(key K) bool {
return exists
}

func (m *Map[K, V]) Size() int {
func (m *Map[K, V]) Len() int {
return int(m.size.Load())
}

Expand Down
4 changes: 2 additions & 2 deletions internal/xsync/map_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func TestMap(t *testing.T) {
2: "two",
3: "three",
}
require.Equal(t, 2, m.Size())
require.Equal(t, 2, m.Len())
var unexp map[int]string
m.Range(func(key int, value string) bool {
if v, ok := exp[key]; ok && v == value {
Expand All @@ -56,7 +56,7 @@ func TestMap(t *testing.T) {
require.Empty(t, exp)
require.Empty(t, unexp)
m.Clear()
require.Zero(t, m.Size())
require.Zero(t, m.Len())
empty := true
m.Range(func(key int, value string) bool {
empty = false
Expand Down

0 comments on commit 0b61046

Please sign in to comment.