renamed concurrent Map Range to Iter. It's a more commonly used name for this functionality

This commit is contained in:
Alex Giurgiu
2023-11-13 21:36:27 +02:00
parent d927344205
commit 01165c66a9
3 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -867,7 +867,7 @@ func (dEnv *DoltEnv) GetRemotes() (*concurrentmap.Map[string, Remote], error) {
func CheckRemoteAddressConflict(absUrl string, remotes *concurrentmap.Map[string, Remote], backups map[string]Remote) (Remote, bool) {
if remotes != nil {
var rm *Remote
remotes.Range(func(key string, value Remote) bool {
remotes.Iter(func(key string, value Remote) bool {
if value.Url == absUrl {
rm = &value
return false
@@ -1134,7 +1134,7 @@ func GetDefaultRemote(rsr RepoStateReader) (Remote, error) {
return NoRemote, ErrNoRemote
} else if remotesLen == 1 {
var remote *Remote
remotes.Range(func(key string, value Remote) bool {
remotes.Iter(func(key string, value Remote) bool {
remote = &value
return false
})
@@ -123,7 +123,7 @@ func NewRemoteItr(ctx *sql.Context, ddb *doltdb.DoltDB) (*RemoteItr, error) {
}
remotes := []env.Remote{}
remoteMap.Range(func(key string, val env.Remote) bool {
remoteMap.Iter(func(key string, val env.Remote) bool {
remotes = append(remotes, val)
return true
})
@@ -66,7 +66,7 @@ func (cm *Map[K, V]) DeepCopy() *Map[K, V] {
return &Map[K, V]{m: newMap}
}
func (cm *Map[K, V]) Range(f func(key K, value V) bool) {
func (cm *Map[K, V]) Iter(f func(key K, value V) bool) {
cm.mu.RLock()
defer cm.mu.RUnlock()
for k, v := range cm.m {