Skip to content

Commit d6d4007

Browse files
authored
fix: use maps.Copy instead of for loop (#1016)
Signed-off-by: Chris Gianelloni <[email protected]>
1 parent 133971d commit d6d4007

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

protocol/state.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
package protocol
1616

1717
import (
18+
"maps"
1819
"time"
1920
)
2021

@@ -71,8 +72,6 @@ type StateMap map[State]StateMapEntry
7172
// since we need to copy the state map in various places
7273
func (s StateMap) Copy() StateMap {
7374
ret := StateMap{}
74-
for k, v := range s {
75-
ret[k] = v
76-
}
75+
maps.Copy(ret, s)
7776
return ret
7877
}

0 commit comments

Comments
 (0)