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

Function isSameArray

internal/storage/postgres/postgres_test.go:17–37  ·  view source on GitHub ↗

isSameArray - check if two arrays are the same

(a, b []string)

Source from the content-addressed store, hash-verified

15
16// isSameArray - check if two arrays are the same
17func isSameArray(a, b []string) bool {
18 if len(a) != len(b) {
19 return false
20 }
21
22 sortedA := make([]string, len(a))
23 copy(sortedA, a)
24 sort.Strings(sortedA)
25
26 sortedB := make([]string, len(b))
27 copy(sortedB, b)
28 sort.Strings(sortedB)
29
30 for i := range sortedA {
31 if sortedA[i] != sortedB[i] {
32 return false
33 }
34 }
35
36 return true
37}

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected