Skip to content

Commit

Permalink
Fix bug in CopyMap
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimir2217 committed Jul 22, 2024
1 parent a96c249 commit a7c155d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Collections/CollectionFunctions.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ func GetKeysFromMap[K comparable, V any](m map[K]V) List[K] {
}

func CopyMap(m *map[any]bool) *map[any]bool {
m2 := make(map[any]bool, len(*m))
var id any
for id, m2[id] = range *m {
m2 := map[any]bool{}
for k, v := range *m {
m2[k] = v
}
return &m2
}

0 comments on commit a7c155d

Please sign in to comment.