MCPcopy Create free account
hub / github.com/baidu/EasyFaaS / Union

Method Union

pkg/funclet/runtime/cgroup/string.go:110–119  ·  view source on GitHub ↗

Union returns a new set which includes items in either s1 or s2. For example: s1 = {a1, a2} s2 = {a3, a4} s1.Union(s2) = {a1, a2, a3, a4} s2.Union(s1) = {a1, a2, a3, a4}

(s2 String)

Source from the content-addressed store, hash-verified

108// s1.Union(s2) = {a1, a2, a3, a4}
109// s2.Union(s1) = {a1, a2, a3, a4}
110func (s1 String) Union(s2 String) String {
111 result := NewString()
112 for key := range s1 {
113 result.Insert(key)
114 }
115 for key := range s2 {
116 result.Insert(key)
117 }
118 return result
119}
120
121// Intersection returns a new set which includes the item in BOTH s1 and s2
122// For example:

Callers

nothing calls this directly

Calls 2

InsertMethod · 0.95
NewStringFunction · 0.85

Tested by

no test coverage detected