MCPcopy Index your code
hub / github.com/apache/casbin / SortedArray2DEquals

Function SortedArray2DEquals

util/util.go:108–126  ·  view source on GitHub ↗

SortedArray2DEquals determines whether two 2-dimensional string arrays are identical.

(a [][]string, b [][]string)

Source from the content-addressed store, hash-verified

106
107// SortedArray2DEquals determines whether two 2-dimensional string arrays are identical.
108func SortedArray2DEquals(a [][]string, b [][]string) bool {
109 if len(a) != len(b) {
110 return false
111 }
112 copyA := make([][]string, len(a))
113 copy(copyA, a)
114 copyB := make([][]string, len(b))
115 copy(copyB, b)
116
117 SortArray2D(copyA)
118 SortArray2D(copyB)
119
120 for i, v := range copyA {
121 if !ArrayEquals(v, copyB[i]) {
122 return false
123 }
124 }
125 return true
126}
127
128// ArrayRemoveDuplicates removes any duplicated elements in a string array.
129func ArrayRemoveDuplicates(s *[]string) {

Callers 2

testGetPolicyFunction · 0.92

Calls 2

SortArray2DFunction · 0.85
ArrayEqualsFunction · 0.85

Tested by 2

testGetPolicyFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…