MCPcopy Create free account
hub / github.com/HoneyLLM/cli2ssh / NewFromSlice

Function NewFromSlice

internal/set/set.go:17–23  ·  view source on GitHub ↗

Create a new set from a slice

(items []T)

Source from the content-addressed store, hash-verified

15
16// Create a new set from a slice
17func NewFromSlice[T comparable](items []T) *Set[T] {
18 s := New[T]()
19 for _, item := range items {
20 s.Add(item)
21 }
22 return s
23}
24
25// Checks if an element exists in the set
26func (s *Set[T]) Has(item T) bool {

Callers

nothing calls this directly

Calls 1

AddMethod · 0.80

Tested by

no test coverage detected