MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / EqualStrings

Function EqualStrings

internal/utils/string.go:46–58  ·  view source on GitHub ↗

EqualStrings 检查两个字符串slice内容是否一致

(s1 []string, s2 []string)

Source from the content-addressed store, hash-verified

44
45// EqualStrings 检查两个字符串slice内容是否一致
46func EqualStrings(s1 []string, s2 []string) bool {
47 if len(s1) != len(s2) {
48 return false
49 }
50 sort.Strings(s1)
51 sort.Strings(s2)
52 for index, v1 := range s1 {
53 if v1 != s2[index] {
54 return false
55 }
56 }
57 return true
58}
59
60// CutPrefix returns s without the provided leading prefix string
61// and reports whether it found the prefix.

Callers 4

TestContainsSameStringsFunction · 0.92
changeAPINodeAddrsMethod · 0.92
LoopMethod · 0.92
ApplyMethod · 0.92

Calls

no outgoing calls

Tested by 1

TestContainsSameStringsFunction · 0.74