18 lines
272 B
Go
18 lines
272 B
Go
package utils
|
|
|
|
import "utils.orly/constraints"
|
|
|
|
func FastEqual[A constraints.Bytes, B constraints.Bytes](a A, b B) (same bool) {
|
|
if len(a) != len(b) {
|
|
return
|
|
}
|
|
ab := []byte(a)
|
|
bb := []byte(b)
|
|
for i, v := range ab {
|
|
if v != bb[i] {
|
|
return
|
|
}
|
|
}
|
|
return true
|
|
}
|