MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / removeAddrs

Function removeAddrs

internal/outbound/sender.go:354–369  ·  view source on GitHub ↗

removeAddrs removes any address in exclude from addrs (case-insensitive).

(addrs []string, exclude []string)

Source from the content-addressed store, hash-verified

352
353// removeAddrs removes any address in exclude from addrs (case-insensitive).
354func removeAddrs(addrs []string, exclude []string) []string {
355 if len(exclude) == 0 {
356 return addrs
357 }
358 set := make(map[string]struct{}, len(exclude))
359 for _, e := range exclude {
360 set[strings.ToLower(e)] = struct{}{}
361 }
362 out := make([]string, 0, len(addrs))
363 for _, a := range addrs {
364 if _, ok := set[strings.ToLower(a)]; !ok {
365 out = append(out, a)
366 }
367 }
368 return out
369}
370
371// dedupe removes duplicate addresses preserving order (case-insensitive).
372func dedupe(addrs []string) []string {

Callers 3

SendMethod · 0.85
TestRemoveAddrsFunction · 0.85
TestCrossFieldDedupeFunction · 0.85

Calls 1

makeFunction · 0.85

Tested by 2

TestRemoveAddrsFunction · 0.68
TestCrossFieldDedupeFunction · 0.68