From be4bf39719751a35f83dd49ba3b017d5f8ff4dd2 Mon Sep 17 00:00:00 2001 From: John Date: Sat, 30 Nov 2019 18:33:51 +0800 Subject: [PATCH] comment update for container --- container/garray/garray_normal_any.go | 8 ++++---- container/garray/garray_normal_int.go | 8 ++++---- container/garray/garray_normal_str.go | 8 ++++---- container/garray/garray_sorted_any.go | 8 ++++---- container/garray/garray_sorted_int.go | 10 +++++----- container/garray/garray_sorted_str.go | 10 +++++----- container/glist/glist.go | 2 +- container/gmap/gmap.go | 16 ++++++++-------- container/gmap/gmap_hash_any_any_map.go | 10 +++++----- container/gmap/gmap_hash_int_any_map.go | 8 ++++---- container/gmap/gmap_hash_int_int_map.go | 8 ++++---- container/gmap/gmap_hash_int_str_map.go | 8 ++++---- container/gmap/gmap_hash_str_any_map.go | 8 ++++---- container/gmap/gmap_hash_str_int_map.go | 8 ++++---- container/gmap/gmap_hash_str_str_map.go | 8 ++++---- container/gmap/gmap_list_map.go | 6 +++--- container/gmap/gmap_tree_map.go | 4 ++-- container/gset/gset_any_set.go | 2 +- container/gset/gset_int_set.go | 2 +- container/gset/gset_str_set.go | 2 +- container/gtree/gtree_avltree.go | 4 ++-- container/gtree/gtree_btree.go | 4 ++-- container/gtree/gtree_redblacktree.go | 4 ++-- 23 files changed, 78 insertions(+), 78 deletions(-) diff --git a/container/garray/garray_normal_any.go b/container/garray/garray_normal_any.go index 818e25b9c..42d7aea03 100644 --- a/container/garray/garray_normal_any.go +++ b/container/garray/garray_normal_any.go @@ -24,7 +24,7 @@ type Array struct { } // New creates and returns an empty array. -// The parameter used to specify whether using array in concurrent-safety, +// The parameter is used to specify whether using array in concurrent-safety, // which is false in default. func New(safe ...bool) *Array { return NewArraySize(0, 0, safe...) @@ -36,7 +36,7 @@ func NewArray(safe ...bool) *Array { } // NewArraySize create and returns an array with given size and cap. -// The parameter used to specify whether using array in concurrent-safety, +// The parameter is used to specify whether using array in concurrent-safety, // which is false in default. func NewArraySize(size int, cap int, safe ...bool) *Array { return &Array{ @@ -56,7 +56,7 @@ func NewFromCopy(array []interface{}, safe ...bool) *Array { } // NewArrayFrom creates and returns an array with given slice . -// The parameter used to specify whether using array in concurrent-safety, +// The parameter is used to specify whether using array in concurrent-safety, // which is false in default. func NewArrayFrom(array []interface{}, safe ...bool) *Array { return &Array{ @@ -66,7 +66,7 @@ func NewArrayFrom(array []interface{}, safe ...bool) *Array { } // NewArrayFromCopy creates and returns an array from a copy of given slice . -// The parameter used to specify whether using array in concurrent-safety, +// The parameter is used to specify whether using array in concurrent-safety, // which is false in default. func NewArrayFromCopy(array []interface{}, safe ...bool) *Array { newArray := make([]interface{}, len(array)) diff --git a/container/garray/garray_normal_int.go b/container/garray/garray_normal_int.go index 196195de6..aa9239b80 100644 --- a/container/garray/garray_normal_int.go +++ b/container/garray/garray_normal_int.go @@ -23,14 +23,14 @@ type IntArray struct { } // NewIntArray creates and returns an empty array. -// The parameter used to specify whether using array in concurrent-safety, +// The parameter is used to specify whether using array in concurrent-safety, // which is false in default. func NewIntArray(safe ...bool) *IntArray { return NewIntArraySize(0, 0, safe...) } // NewIntArraySize create and returns an array with given size and cap. -// The parameter used to specify whether using array in concurrent-safety, +// The parameter is used to specify whether using array in concurrent-safety, // which is false in default. func NewIntArraySize(size int, cap int, safe ...bool) *IntArray { return &IntArray{ @@ -40,7 +40,7 @@ func NewIntArraySize(size int, cap int, safe ...bool) *IntArray { } // NewIntArrayFrom creates and returns an array with given slice . -// The parameter used to specify whether using array in concurrent-safety, +// The parameter is used to specify whether using array in concurrent-safety, // which is false in default. func NewIntArrayFrom(array []int, safe ...bool) *IntArray { return &IntArray{ @@ -50,7 +50,7 @@ func NewIntArrayFrom(array []int, safe ...bool) *IntArray { } // NewIntArrayFromCopy creates and returns an array from a copy of given slice . -// The parameter used to specify whether using array in concurrent-safety, +// The parameter is used to specify whether using array in concurrent-safety, // which is false in default. func NewIntArrayFromCopy(array []int, safe ...bool) *IntArray { newArray := make([]int, len(array)) diff --git a/container/garray/garray_normal_str.go b/container/garray/garray_normal_str.go index 6d421d142..af54e5b0d 100644 --- a/container/garray/garray_normal_str.go +++ b/container/garray/garray_normal_str.go @@ -25,14 +25,14 @@ type StrArray struct { } // NewStrArray creates and returns an empty array. -// The parameter used to specify whether using array in concurrent-safety, +// The parameter is used to specify whether using array in concurrent-safety, // which is false in default. func NewStrArray(safe ...bool) *StrArray { return NewStrArraySize(0, 0, safe...) } // NewStrArraySize create and returns an array with given size and cap. -// The parameter used to specify whether using array in concurrent-safety, +// The parameter is used to specify whether using array in concurrent-safety, // which is false in default. func NewStrArraySize(size int, cap int, safe ...bool) *StrArray { return &StrArray{ @@ -42,7 +42,7 @@ func NewStrArraySize(size int, cap int, safe ...bool) *StrArray { } // NewStrArrayFrom creates and returns an array with given slice . -// The parameter used to specify whether using array in concurrent-safety, +// The parameter is used to specify whether using array in concurrent-safety, // which is false in default. func NewStrArrayFrom(array []string, safe ...bool) *StrArray { return &StrArray{ @@ -52,7 +52,7 @@ func NewStrArrayFrom(array []string, safe ...bool) *StrArray { } // NewStrArrayFromCopy creates and returns an array from a copy of given slice . -// The parameter used to specify whether using array in concurrent-safety, +// The parameter is used to specify whether using array in concurrent-safety, // which is false in default. func NewStrArrayFromCopy(array []string, safe ...bool) *StrArray { newArray := make([]string, len(array)) diff --git a/container/garray/garray_sorted_any.go b/container/garray/garray_sorted_any.go index 67409b6ca..5dcc12a02 100644 --- a/container/garray/garray_sorted_any.go +++ b/container/garray/garray_sorted_any.go @@ -29,7 +29,7 @@ type SortedArray struct { } // NewSortedArray creates and returns an empty sorted array. -// The parameter used to specify whether using array in concurrent-safety, which is false in default. +// The parameter is used to specify whether using array in concurrent-safety, which is false in default. // The parameter used to compare values to sort in array, // if it returns value < 0, means v1 < v2; // if it returns value = 0, means v1 = v2; @@ -39,7 +39,7 @@ func NewSortedArray(comparator func(a, b interface{}) int, safe ...bool) *Sorted } // NewSortedArraySize create and returns an sorted array with given size and cap. -// The parameter used to specify whether using array in concurrent-safety, +// The parameter is used to specify whether using array in concurrent-safety, // which is false in default. func NewSortedArraySize(cap int, comparator func(a, b interface{}) int, safe ...bool) *SortedArray { return &SortedArray{ @@ -51,7 +51,7 @@ func NewSortedArraySize(cap int, comparator func(a, b interface{}) int, safe ... } // NewSortedArrayFrom creates and returns an sorted array with given slice . -// The parameter used to specify whether using array in concurrent-safety, +// The parameter is used to specify whether using array in concurrent-safety, // which is false in default. func NewSortedArrayFrom(array []interface{}, comparator func(a, b interface{}) int, safe ...bool) *SortedArray { a := NewSortedArraySize(0, comparator, safe...) @@ -63,7 +63,7 @@ func NewSortedArrayFrom(array []interface{}, comparator func(a, b interface{}) i } // NewSortedArrayFromCopy creates and returns an sorted array from a copy of given slice . -// The parameter used to specify whether using array in concurrent-safety, +// The parameter is used to specify whether using array in concurrent-safety, // which is false in default. func NewSortedArrayFromCopy(array []interface{}, comparator func(a, b interface{}) int, safe ...bool) *SortedArray { newArray := make([]interface{}, len(array)) diff --git a/container/garray/garray_sorted_int.go b/container/garray/garray_sorted_int.go index b90bf2734..3b42b74f0 100644 --- a/container/garray/garray_sorted_int.go +++ b/container/garray/garray_sorted_int.go @@ -27,14 +27,14 @@ type SortedIntArray struct { } // NewSortedIntArray creates and returns an empty sorted array. -// The parameter used to specify whether using array in concurrent-safety, +// The parameter is used to specify whether using array in concurrent-safety, // which is false in default. func NewSortedIntArray(safe ...bool) *SortedIntArray { return NewSortedIntArraySize(0, safe...) } // NewSortedIntArrayComparator creates and returns an empty sorted array with specified comparator. -// The parameter used to specify whether using array in concurrent-safety which is false in default. +// The parameter is used to specify whether using array in concurrent-safety which is false in default. func NewSortedIntArrayComparator(comparator func(a, b int) int, safe ...bool) *SortedIntArray { array := NewSortedIntArray(safe...) array.comparator = comparator @@ -42,7 +42,7 @@ func NewSortedIntArrayComparator(comparator func(a, b int) int, safe ...bool) *S } // NewSortedIntArraySize create and returns an sorted array with given size and cap. -// The parameter used to specify whether using array in concurrent-safety, +// The parameter is used to specify whether using array in concurrent-safety, // which is false in default. func NewSortedIntArraySize(cap int, safe ...bool) *SortedIntArray { return &SortedIntArray{ @@ -54,7 +54,7 @@ func NewSortedIntArraySize(cap int, safe ...bool) *SortedIntArray { } // NewIntArrayFrom creates and returns an sorted array with given slice . -// The parameter used to specify whether using array in concurrent-safety, +// The parameter is used to specify whether using array in concurrent-safety, // which is false in default. func NewSortedIntArrayFrom(array []int, safe ...bool) *SortedIntArray { a := NewSortedIntArraySize(0, safe...) @@ -64,7 +64,7 @@ func NewSortedIntArrayFrom(array []int, safe ...bool) *SortedIntArray { } // NewSortedIntArrayFromCopy creates and returns an sorted array from a copy of given slice . -// The parameter used to specify whether using array in concurrent-safety, +// The parameter is used to specify whether using array in concurrent-safety, // which is false in default. func NewSortedIntArrayFromCopy(array []int, safe ...bool) *SortedIntArray { newArray := make([]int, len(array)) diff --git a/container/garray/garray_sorted_str.go b/container/garray/garray_sorted_str.go index bdf754aad..e7092b4a6 100644 --- a/container/garray/garray_sorted_str.go +++ b/container/garray/garray_sorted_str.go @@ -28,14 +28,14 @@ type SortedStrArray struct { } // NewSortedStrArray creates and returns an empty sorted array. -// The parameter used to specify whether using array in concurrent-safety, +// The parameter is used to specify whether using array in concurrent-safety, // which is false in default. func NewSortedStrArray(safe ...bool) *SortedStrArray { return NewSortedStrArraySize(0, safe...) } // NewSortedStrArrayComparator creates and returns an empty sorted array with specified comparator. -// The parameter used to specify whether using array in concurrent-safety which is false in default. +// The parameter is used to specify whether using array in concurrent-safety which is false in default. func NewSortedStrArrayComparator(comparator func(a, b string) int, safe ...bool) *SortedStrArray { array := NewSortedStrArray(safe...) array.comparator = comparator @@ -43,7 +43,7 @@ func NewSortedStrArrayComparator(comparator func(a, b string) int, safe ...bool) } // NewSortedStrArraySize create and returns an sorted array with given size and cap. -// The parameter used to specify whether using array in concurrent-safety, +// The parameter is used to specify whether using array in concurrent-safety, // which is false in default. func NewSortedStrArraySize(cap int, safe ...bool) *SortedStrArray { return &SortedStrArray{ @@ -55,7 +55,7 @@ func NewSortedStrArraySize(cap int, safe ...bool) *SortedStrArray { } // NewSortedStrArrayFrom creates and returns an sorted array with given slice . -// The parameter used to specify whether using array in concurrent-safety, +// The parameter is used to specify whether using array in concurrent-safety, // which is false in default. func NewSortedStrArrayFrom(array []string, safe ...bool) *SortedStrArray { a := NewSortedStrArraySize(0, safe...) @@ -65,7 +65,7 @@ func NewSortedStrArrayFrom(array []string, safe ...bool) *SortedStrArray { } // NewSortedStrArrayFromCopy creates and returns an sorted array from a copy of given slice . -// The parameter used to specify whether using array in concurrent-safety, +// The parameter is used to specify whether using array in concurrent-safety, // which is false in default. func NewSortedStrArrayFromCopy(array []string, safe ...bool) *SortedStrArray { newArray := make([]string, len(array)) diff --git a/container/glist/glist.go b/container/glist/glist.go index 082c6db73..f8d5db696 100644 --- a/container/glist/glist.go +++ b/container/glist/glist.go @@ -36,7 +36,7 @@ func New(safe ...bool) *List { } // NewFrom creates and returns a list from a copy of given slice . -// The parameter used to specify whether using list in concurrent-safety, +// The parameter is used to specify whether using list in concurrent-safety, // which is false in default. func NewFrom(array []interface{}, safe ...bool) *List { l := list.New() diff --git a/container/gmap/gmap.go b/container/gmap/gmap.go index 5d1cec522..1108262b1 100644 --- a/container/gmap/gmap.go +++ b/container/gmap/gmap.go @@ -11,33 +11,33 @@ package gmap type Map = AnyAnyMap type HashMap = AnyAnyMap -// New returns an empty hash map. -// The parameter used to specify whether using map in concurrent-safety, +// New creates and returns an empty hash map. +// The parameter is used to specify whether using map in concurrent-safety, // which is false in default. func New(safe ...bool) *Map { return NewAnyAnyMap(safe...) } -// NewFrom returns a hash map from given map . +// NewFrom creates and returns a hash map from given map . // Note that, the param map will be set as the underlying data map(no deep copy), // there might be some concurrent-safe issues when changing the map outside. -// The parameter used to specify whether using tree in concurrent-safety, +// The parameter is used to specify whether using tree in concurrent-safety, // which is false in default. func NewFrom(data map[interface{}]interface{}, safe ...bool) *Map { return NewAnyAnyMapFrom(data, safe...) } -// NewHashMap returns an empty hash map. -// The parameter used to specify whether using map in concurrent-safety, +// NewHashMap creates and returns an empty hash map. +// The parameter is used to specify whether using map in concurrent-safety, // which is false in default. func NewHashMap(safe ...bool) *Map { return NewAnyAnyMap(safe...) } -// NewHashMapFrom returns a hash map from given map . +// NewHashMapFrom creates and returns a hash map from given map . // Note that, the param map will be set as the underlying data map(no deep copy), // there might be some concurrent-safe issues when changing the map outside. -// The parameter used to specify whether using tree in concurrent-safety, +// The parameter is used to specify whether using tree in concurrent-safety, // which is false in default. func NewHashMapFrom(data map[interface{}]interface{}, safe ...bool) *Map { return NewAnyAnyMapFrom(data, safe...) diff --git a/container/gmap/gmap_hash_any_any_map.go b/container/gmap/gmap_hash_any_any_map.go index 2929bec0b..5b8709a7c 100644 --- a/container/gmap/gmap_hash_any_any_map.go +++ b/container/gmap/gmap_hash_any_any_map.go @@ -22,8 +22,8 @@ type AnyAnyMap struct { data map[interface{}]interface{} } -// NewAnyAnyMap returns an empty hash map. -// The parameter used to specify whether using map in concurrent-safety, +// NewAnyAnyMap creates and returns an empty hash map. +// The parameter is used to specify whether using map in concurrent-safety, // which is false in default. func NewAnyAnyMap(safe ...bool) *AnyAnyMap { return &AnyAnyMap{ @@ -32,7 +32,7 @@ func NewAnyAnyMap(safe ...bool) *AnyAnyMap { } } -// NewAnyAnyMapFrom returns a hash map from given map . +// NewAnyAnyMapFrom creates and returns a hash map from given map . // Note that, the param map will be set as the underlying data map(no deep copy), // there might be some concurrent-safe issues when changing the map outside. func NewAnyAnyMapFrom(data map[interface{}]interface{}, safe ...bool) *AnyAnyMap { @@ -75,7 +75,7 @@ func (m *AnyAnyMap) Map() map[interface{}]interface{} { return data } -// MapCopy returns a copy of the data of the hash map. +// MapCopy returns a copy of the underlying data of the hash map. func (m *AnyAnyMap) MapCopy() map[interface{}]interface{} { m.mu.RLock() defer m.mu.RUnlock() @@ -86,7 +86,7 @@ func (m *AnyAnyMap) MapCopy() map[interface{}]interface{} { return data } -// MapStrAny returns a copy of the data of the map as map[string]interface{}. +// MapStrAny returns a copy of the underlying data of the map as map[string]interface{}. func (m *AnyAnyMap) MapStrAny() map[string]interface{} { m.mu.RLock() data := make(map[string]interface{}, len(m.data)) diff --git a/container/gmap/gmap_hash_int_any_map.go b/container/gmap/gmap_hash_int_any_map.go index c3eae2d8e..677bd77a8 100644 --- a/container/gmap/gmap_hash_int_any_map.go +++ b/container/gmap/gmap_hash_int_any_map.go @@ -23,7 +23,7 @@ type IntAnyMap struct { } // NewIntAnyMap returns an empty IntAnyMap object. -// The parameter used to specify whether using map in concurrent-safety, +// The parameter is used to specify whether using map in concurrent-safety, // which is false in default. func NewIntAnyMap(safe ...bool) *IntAnyMap { return &IntAnyMap{ @@ -32,7 +32,7 @@ func NewIntAnyMap(safe ...bool) *IntAnyMap { } } -// NewIntAnyMapFrom returns a hash map from given map . +// NewIntAnyMapFrom creates and returns a hash map from given map . // Note that, the param map will be set as the underlying data map(no deep copy), // there might be some concurrent-safe issues when changing the map outside. func NewIntAnyMapFrom(data map[int]interface{}, safe ...bool) *IntAnyMap { @@ -75,7 +75,7 @@ func (m *IntAnyMap) Map() map[int]interface{} { return data } -// MapStrAny returns a copy of the data of the map as map[string]interface{}. +// MapStrAny returns a copy of the underlying data of the map as map[string]interface{}. func (m *IntAnyMap) MapStrAny() map[string]interface{} { m.mu.RLock() data := make(map[string]interface{}, len(m.data)) @@ -86,7 +86,7 @@ func (m *IntAnyMap) MapStrAny() map[string]interface{} { return data } -// MapCopy returns a copy of the data of the hash map. +// MapCopy returns a copy of the underlying data of the hash map. func (m *IntAnyMap) MapCopy() map[int]interface{} { m.mu.RLock() defer m.mu.RUnlock() diff --git a/container/gmap/gmap_hash_int_int_map.go b/container/gmap/gmap_hash_int_int_map.go index abd89fccc..f93f0f7a4 100644 --- a/container/gmap/gmap_hash_int_int_map.go +++ b/container/gmap/gmap_hash_int_int_map.go @@ -21,7 +21,7 @@ type IntIntMap struct { } // NewIntIntMap returns an empty IntIntMap object. -// The parameter used to specify whether using map in concurrent-safety, +// The parameter is used to specify whether using map in concurrent-safety, // which is false in default. func NewIntIntMap(safe ...bool) *IntIntMap { return &IntIntMap{ @@ -30,7 +30,7 @@ func NewIntIntMap(safe ...bool) *IntIntMap { } } -// NewIntIntMapFrom returns a hash map from given map . +// NewIntIntMapFrom creates and returns a hash map from given map . // Note that, the param map will be set as the underlying data map(no deep copy), // there might be some concurrent-safe issues when changing the map outside. func NewIntIntMapFrom(data map[int]int, safe ...bool) *IntIntMap { @@ -73,7 +73,7 @@ func (m *IntIntMap) Map() map[int]int { return data } -// MapStrAny returns a copy of the data of the map as map[string]interface{}. +// MapStrAny returns a copy of the underlying data of the map as map[string]interface{}. func (m *IntIntMap) MapStrAny() map[string]interface{} { m.mu.RLock() data := make(map[string]interface{}, len(m.data)) @@ -84,7 +84,7 @@ func (m *IntIntMap) MapStrAny() map[string]interface{} { return data } -// MapCopy returns a copy of the data of the hash map. +// MapCopy returns a copy of the underlying data of the hash map. func (m *IntIntMap) MapCopy() map[int]int { m.mu.RLock() defer m.mu.RUnlock() diff --git a/container/gmap/gmap_hash_int_str_map.go b/container/gmap/gmap_hash_int_str_map.go index 785702fe9..fb7340633 100644 --- a/container/gmap/gmap_hash_int_str_map.go +++ b/container/gmap/gmap_hash_int_str_map.go @@ -21,7 +21,7 @@ type IntStrMap struct { } // NewIntStrMap returns an empty IntStrMap object. -// The parameter used to specify whether using map in concurrent-safety, +// The parameter is used to specify whether using map in concurrent-safety, // which is false in default. func NewIntStrMap(safe ...bool) *IntStrMap { return &IntStrMap{ @@ -30,7 +30,7 @@ func NewIntStrMap(safe ...bool) *IntStrMap { } } -// NewIntStrMapFrom returns a hash map from given map . +// NewIntStrMapFrom creates and returns a hash map from given map . // Note that, the param map will be set as the underlying data map(no deep copy), // there might be some concurrent-safe issues when changing the map outside. func NewIntStrMapFrom(data map[int]string, safe ...bool) *IntStrMap { @@ -73,7 +73,7 @@ func (m *IntStrMap) Map() map[int]string { return data } -// MapStrAny returns a copy of the data of the map as map[string]interface{}. +// MapStrAny returns a copy of the underlying data of the map as map[string]interface{}. func (m *IntStrMap) MapStrAny() map[string]interface{} { m.mu.RLock() data := make(map[string]interface{}, len(m.data)) @@ -84,7 +84,7 @@ func (m *IntStrMap) MapStrAny() map[string]interface{} { return data } -// MapCopy returns a copy of the data of the hash map. +// MapCopy returns a copy of the underlying data of the hash map. func (m *IntStrMap) MapCopy() map[int]string { m.mu.RLock() defer m.mu.RUnlock() diff --git a/container/gmap/gmap_hash_str_any_map.go b/container/gmap/gmap_hash_str_any_map.go index fecc5fe1d..feaf3da4a 100644 --- a/container/gmap/gmap_hash_str_any_map.go +++ b/container/gmap/gmap_hash_str_any_map.go @@ -23,7 +23,7 @@ type StrAnyMap struct { } // NewStrAnyMap returns an empty StrAnyMap object. -// The parameter used to specify whether using map in concurrent-safety, +// The parameter is used to specify whether using map in concurrent-safety, // which is false in default. func NewStrAnyMap(safe ...bool) *StrAnyMap { return &StrAnyMap{ @@ -32,7 +32,7 @@ func NewStrAnyMap(safe ...bool) *StrAnyMap { } } -// NewStrAnyMapFrom returns a hash map from given map . +// NewStrAnyMapFrom creates and returns a hash map from given map . // Note that, the param map will be set as the underlying data map(no deep copy), // there might be some concurrent-safe issues when changing the map outside. func NewStrAnyMapFrom(data map[string]interface{}, safe ...bool) *StrAnyMap { @@ -75,12 +75,12 @@ func (m *StrAnyMap) Map() map[string]interface{} { return data } -// MapStrAny returns a copy of the data of the map as map[string]interface{}. +// MapStrAny returns a copy of the underlying data of the map as map[string]interface{}. func (m *StrAnyMap) MapStrAny() map[string]interface{} { return m.Map() } -// MapCopy returns a copy of the data of the hash map. +// MapCopy returns a copy of the underlying data of the hash map. func (m *StrAnyMap) MapCopy() map[string]interface{} { m.mu.RLock() defer m.mu.RUnlock() diff --git a/container/gmap/gmap_hash_str_int_map.go b/container/gmap/gmap_hash_str_int_map.go index 732a77b35..04ed0669e 100644 --- a/container/gmap/gmap_hash_str_int_map.go +++ b/container/gmap/gmap_hash_str_int_map.go @@ -21,7 +21,7 @@ type StrIntMap struct { } // NewStrIntMap returns an empty StrIntMap object. -// The parameter used to specify whether using map in concurrent-safety, +// The parameter is used to specify whether using map in concurrent-safety, // which is false in default. func NewStrIntMap(safe ...bool) *StrIntMap { return &StrIntMap{ @@ -30,7 +30,7 @@ func NewStrIntMap(safe ...bool) *StrIntMap { } } -// NewStrIntMapFrom returns a hash map from given map . +// NewStrIntMapFrom creates and returns a hash map from given map . // Note that, the param map will be set as the underlying data map(no deep copy), // there might be some concurrent-safe issues when changing the map outside. func NewStrIntMapFrom(data map[string]int, safe ...bool) *StrIntMap { @@ -73,7 +73,7 @@ func (m *StrIntMap) Map() map[string]int { return data } -// MapStrAny returns a copy of the data of the map as map[string]interface{}. +// MapStrAny returns a copy of the underlying data of the map as map[string]interface{}. func (m *StrIntMap) MapStrAny() map[string]interface{} { m.mu.RLock() data := make(map[string]interface{}, len(m.data)) @@ -84,7 +84,7 @@ func (m *StrIntMap) MapStrAny() map[string]interface{} { return data } -// MapCopy returns a copy of the data of the hash map. +// MapCopy returns a copy of the underlying data of the hash map. func (m *StrIntMap) MapCopy() map[string]int { m.mu.RLock() defer m.mu.RUnlock() diff --git a/container/gmap/gmap_hash_str_str_map.go b/container/gmap/gmap_hash_str_str_map.go index 92c6a5456..b38043ab5 100644 --- a/container/gmap/gmap_hash_str_str_map.go +++ b/container/gmap/gmap_hash_str_str_map.go @@ -21,7 +21,7 @@ type StrStrMap struct { } // NewStrStrMap returns an empty StrStrMap object. -// The parameter used to specify whether using map in concurrent-safety, +// The parameter is used to specify whether using map in concurrent-safety, // which is false in default. func NewStrStrMap(safe ...bool) *StrStrMap { return &StrStrMap{ @@ -30,7 +30,7 @@ func NewStrStrMap(safe ...bool) *StrStrMap { } } -// NewStrStrMapFrom returns a hash map from given map . +// NewStrStrMapFrom creates and returns a hash map from given map . // Note that, the param map will be set as the underlying data map(no deep copy), // there might be some concurrent-safe issues when changing the map outside. func NewStrStrMapFrom(data map[string]string, safe ...bool) *StrStrMap { @@ -73,7 +73,7 @@ func (m *StrStrMap) Map() map[string]string { return data } -// MapStrAny returns a copy of the data of the map as map[string]interface{}. +// MapStrAny returns a copy of the underlying data of the map as map[string]interface{}. func (m *StrStrMap) MapStrAny() map[string]interface{} { m.mu.RLock() data := make(map[string]interface{}, len(m.data)) @@ -84,7 +84,7 @@ func (m *StrStrMap) MapStrAny() map[string]interface{} { return data } -// MapCopy returns a copy of the data of the hash map. +// MapCopy returns a copy of the underlying data of the hash map. func (m *StrStrMap) MapCopy() map[string]string { m.mu.RLock() defer m.mu.RUnlock() diff --git a/container/gmap/gmap_list_map.go b/container/gmap/gmap_list_map.go index 937dcacef..eaee3ab1b 100644 --- a/container/gmap/gmap_list_map.go +++ b/container/gmap/gmap_list_map.go @@ -31,7 +31,7 @@ type gListMapNode struct { // NewListMap returns an empty link map. // ListMap is backed by a hash table to store values and doubly-linked list to store ordering. -// The parameter used to specify whether using map in concurrent-safety, +// The parameter is used to specify whether using map in concurrent-safety, // which is false in default. func NewListMap(safe ...bool) *ListMap { return &ListMap{ @@ -107,7 +107,7 @@ func (m *ListMap) Replace(data map[interface{}]interface{}) { m.mu.Unlock() } -// Map returns a copy of the data of the map. +// Map returns a copy of the underlying data of the map. func (m *ListMap) Map() map[interface{}]interface{} { m.mu.RLock() node := (*gListMapNode)(nil) @@ -121,7 +121,7 @@ func (m *ListMap) Map() map[interface{}]interface{} { return data } -// MapStrAny returns a copy of the data of the map as map[string]interface{}. +// MapStrAny returns a copy of the underlying data of the map as map[string]interface{}. func (m *ListMap) MapStrAny() map[string]interface{} { m.mu.RLock() node := (*gListMapNode)(nil) diff --git a/container/gmap/gmap_tree_map.go b/container/gmap/gmap_tree_map.go index 1c7b3d36b..9bcce1b62 100644 --- a/container/gmap/gmap_tree_map.go +++ b/container/gmap/gmap_tree_map.go @@ -14,7 +14,7 @@ import ( type TreeMap = gtree.RedBlackTree // NewTreeMap instantiates a tree map with the custom comparator. -// The parameter used to specify whether using tree in concurrent-safety, +// The parameter is used to specify whether using tree in concurrent-safety, // which is false in default. func NewTreeMap(comparator func(v1, v2 interface{}) int, safe ...bool) *TreeMap { return gtree.NewRedBlackTree(comparator, safe...) @@ -23,7 +23,7 @@ func NewTreeMap(comparator func(v1, v2 interface{}) int, safe ...bool) *TreeMap // NewTreeMapFrom instantiates a tree map with the custom comparator and map. // Note that, the param map will be set as the underlying data map(no deep copy), // there might be some concurrent-safe issues when changing the map outside. -// The parameter used to specify whether using tree in concurrent-safety, +// The parameter is used to specify whether using tree in concurrent-safety, // which is false in default. func NewTreeMapFrom(comparator func(v1, v2 interface{}) int, data map[interface{}]interface{}, safe ...bool) *TreeMap { return gtree.NewRedBlackTreeFrom(comparator, data, safe...) diff --git a/container/gset/gset_any_set.go b/container/gset/gset_any_set.go index 88883259d..bb7474413 100644 --- a/container/gset/gset_any_set.go +++ b/container/gset/gset_any_set.go @@ -21,7 +21,7 @@ type Set struct { } // New create and returns a new set, which contains un-repeated items. -// The parameter used to specify whether using set in concurrent-safety, +// The parameter is used to specify whether using set in concurrent-safety, // which is false in default. func New(safe ...bool) *Set { return NewSet(safe...) diff --git a/container/gset/gset_int_set.go b/container/gset/gset_int_set.go index 457fca8c1..0ed01a143 100644 --- a/container/gset/gset_int_set.go +++ b/container/gset/gset_int_set.go @@ -20,7 +20,7 @@ type IntSet struct { } // New create and returns a new set, which contains un-repeated items. -// The parameter used to specify whether using set in concurrent-safety, +// The parameter is used to specify whether using set in concurrent-safety, // which is false in default. func NewIntSet(safe ...bool) *IntSet { return &IntSet{ diff --git a/container/gset/gset_str_set.go b/container/gset/gset_str_set.go index a8c41269d..063c8ff91 100644 --- a/container/gset/gset_str_set.go +++ b/container/gset/gset_str_set.go @@ -21,7 +21,7 @@ type StrSet struct { } // New create and returns a new set, which contains un-repeated items. -// The parameter used to specify whether using set in concurrent-safety, +// The parameter is used to specify whether using set in concurrent-safety, // which is false in default. func NewStrSet(safe ...bool) *StrSet { return &StrSet{ diff --git a/container/gtree/gtree_avltree.go b/container/gtree/gtree_avltree.go index 59c337046..ba41adce4 100644 --- a/container/gtree/gtree_avltree.go +++ b/container/gtree/gtree_avltree.go @@ -34,7 +34,7 @@ type AVLTreeNode struct { } // NewAVLTree instantiates an AVL tree with the custom key comparator. -// The parameter used to specify whether using tree in concurrent-safety, +// The parameter is used to specify whether using tree in concurrent-safety, // which is false in default. func NewAVLTree(comparator func(v1, v2 interface{}) int, safe ...bool) *AVLTree { return &AVLTree{ @@ -44,7 +44,7 @@ func NewAVLTree(comparator func(v1, v2 interface{}) int, safe ...bool) *AVLTree } // NewAVLTreeFrom instantiates an AVL tree with the custom key comparator and data map. -// The parameter used to specify whether using tree in concurrent-safety, +// The parameter is used to specify whether using tree in concurrent-safety, // which is false in default. func NewAVLTreeFrom(comparator func(v1, v2 interface{}) int, data map[interface{}]interface{}, safe ...bool) *AVLTree { tree := NewAVLTree(comparator, safe...) diff --git a/container/gtree/gtree_btree.go b/container/gtree/gtree_btree.go index 0372f9bbe..b174cdd28 100644 --- a/container/gtree/gtree_btree.go +++ b/container/gtree/gtree_btree.go @@ -41,7 +41,7 @@ type BTreeEntry struct { } // NewBTree instantiates a B-tree with (maximum number of children) and a custom key comparator. -// The parameter used to specify whether using tree in concurrent-safety, +// The parameter is used to specify whether using tree in concurrent-safety, // which is false in default. // Note that the must be greater or equal than 3, or else it panics. func NewBTree(m int, comparator func(v1, v2 interface{}) int, safe ...bool) *BTree { @@ -56,7 +56,7 @@ func NewBTree(m int, comparator func(v1, v2 interface{}) int, safe ...bool) *BTr } // NewBTreeFrom instantiates a B-tree with (maximum number of children), a custom key comparator and data map. -// The parameter used to specify whether using tree in concurrent-safety, +// The parameter is used to specify whether using tree in concurrent-safety, // which is false in default. func NewBTreeFrom(m int, comparator func(v1, v2 interface{}) int, data map[interface{}]interface{}, safe ...bool) *BTree { tree := NewBTree(m, comparator, safe...) diff --git a/container/gtree/gtree_redblacktree.go b/container/gtree/gtree_redblacktree.go index 6284e403a..21b623cc2 100644 --- a/container/gtree/gtree_redblacktree.go +++ b/container/gtree/gtree_redblacktree.go @@ -41,7 +41,7 @@ type RedBlackTreeNode struct { } // NewRedBlackTree instantiates a red-black tree with the custom key comparator. -// The parameter used to specify whether using tree in concurrent-safety, +// The parameter is used to specify whether using tree in concurrent-safety, // which is false in default. func NewRedBlackTree(comparator func(v1, v2 interface{}) int, safe ...bool) *RedBlackTree { return &RedBlackTree{ @@ -51,7 +51,7 @@ func NewRedBlackTree(comparator func(v1, v2 interface{}) int, safe ...bool) *Red } // NewRedBlackTreeFrom instantiates a red-black tree with the custom key comparator and map. -// The parameter used to specify whether using tree in concurrent-safety, +// The parameter is used to specify whether using tree in concurrent-safety, // which is false in default. func NewRedBlackTreeFrom(comparator func(v1, v2 interface{}) int, data map[interface{}]interface{}, safe ...bool) *RedBlackTree { tree := NewRedBlackTree(comparator, safe...)