MCPcopy Create free account
hub / github.com/davecheney/pub / Equal

Function Equal

internal/algorithms/algorithms.go:25–33  ·  view source on GitHub ↗

Equal returns true if all elements are equal.

(first, second T, rest ...T)

Source from the content-addressed store, hash-verified

23
24// Equal returns true if all elements are equal.
25func Equal[T comparable](first, second T, rest ...T) bool {
26 if first != second {
27 return false
28 }
29 if len(rest) > 0 {
30 return Equal(second, rest[0], rest[1:]...)
31 }
32 return true
33}
34
35// Reverse reverses the order of the elements in the slice.
36func Reverse[T any](a []T) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected