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

Function SetEquals

util/util.go:153–167  ·  view source on GitHub ↗

SetEquals determines whether two string sets are identical.

(a []string, b []string)

Source from the content-addressed store, hash-verified

151
152// SetEquals determines whether two string sets are identical.
153func SetEquals(a []string, b []string) bool {
154 if len(a) != len(b) {
155 return false
156 }
157
158 sort.Strings(a)
159 sort.Strings(b)
160
161 for i, v := range a {
162 if v != b[i] {
163 return false
164 }
165 }
166 return true
167}
168
169// SetEquals determines whether two int sets are identical.
170func SetEqualsInt(a []int, b []int) bool {

Callers 15

testGetUsersInDomainFunction · 0.92
testGetRolesInDomainFunction · 0.92
testGetDomainsForUserFunction · 0.92
testGetAllUsersByDomainFunction · 0.92
testGetAllRolesByDomainFunction · 0.92
testDeleteDomainsFunction · 0.92
testGetRolesFunction · 0.92
testGetUsersFunction · 0.92
testGetImplicitRolesFunction · 0.92

Calls 1

StringsMethod · 0.65

Tested by 15

testGetUsersInDomainFunction · 0.74
testGetRolesInDomainFunction · 0.74
testGetDomainsForUserFunction · 0.74
testGetAllUsersByDomainFunction · 0.74
testGetAllRolesByDomainFunction · 0.74
testDeleteDomainsFunction · 0.74
testGetRolesFunction · 0.74
testGetUsersFunction · 0.74
testGetImplicitRolesFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…