Skip to content

Commit e956da3

Browse files
committed
Replace manual slice equality code with slices.Equal()
1 parent f511715 commit e956da3

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

config.go

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"fmt"
66
"io"
77
"reflect"
8+
"slices"
89
)
910

1011
var randReader = rand.Reader
@@ -39,15 +40,7 @@ func WorkFactorsEqual(a, b WorkFactor) bool {
3940
if err != nil {
4041
return false
4142
}
42-
if len(aM) != len(bM) {
43-
return false
44-
}
45-
for i, aV := range aM {
46-
if aV != bM[i] {
47-
return false
48-
}
49-
}
50-
return true
43+
return slices.Equal(aM, bM)
5144
}
5245

5346
// Pbkdf2WorkFactor specifies the work/cost parameters for PBKDF2

0 commit comments

Comments
 (0)