MCPcopy Create free account
hub / github.com/Permify/permify / isSameArray

Function isSameArray

internal/engines/engine_test.go:52–72  ·  view source on GitHub ↗

isSameArray - check if two arrays are the same

(a, b []string)

Source from the content-addressed store, hash-verified

50
51// isSameArray - check if two arrays are the same
52func isSameArray(a, b []string) bool {
53 if len(a) != len(b) {
54 return false
55 }
56
57 sortedA := make([]string, len(a))
58 copy(sortedA, a)
59 sort.Strings(sortedA)
60
61 sortedB := make([]string, len(b))
62 copy(sortedB, b)
63 sort.Strings(sortedB)
64
65 for i := range sortedA {
66 if sortedA[i] != sortedB[i] {
67 return false
68 }
69 }
70
71 return true
72}

Callers 1

utils_test.goFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected