Skip to content

Commit

Permalink
merge dev into testing
Browse files Browse the repository at this point in the history
  • Loading branch information
lixizan committed Jun 7, 2024
2 parents cfdae56 + 7400863 commit 7d814db
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion session_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ type (
// NewConcurrentMap create a new concurrency-safe map
// arg0 represents the number of shardings; arg1 represents the initialized capacity of a sharding.
func NewConcurrentMap[K comparable, V any](size ...uint64) *ConcurrentMap[K, V] {
sharding, capacity := uint64(16), uint64(0)
sharding, capacity := uint64(0), uint64(0)
if len(size) >= 1 {
sharding = size[0]
}
Expand Down
3 changes: 2 additions & 1 deletion session_storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ func TestMap_Range(t *testing.T) {
func TestConcurrentMap(t *testing.T) {
var as = assert.New(t)
var m1 = make(map[string]any)
var m2 = NewConcurrentMap[string, uint32](5)
var m2 = NewConcurrentMap[string, uint32]()
as.Equal(m2.sharding, uint64(16))
var count = internal.AlphabetNumeric.Intn(1000)
for i := 0; i < count; i++ {
var key = string(internal.AlphabetNumeric.Generate(10))
Expand Down

0 comments on commit 7d814db

Please sign in to comment.