MCPcopy
hub / github.com/git-lfs/git-lfs / Add

Method Add

tools/ordered_set.go:40–49  ·  view source on GitHub ↗

Add adds the given element "i" to the ordered set, unless the element is already present. It returns whether or not the element was added.

(i string)

Source from the content-addressed store, hash-verified

38// Add adds the given element "i" to the ordered set, unless the element is
39// already present. It returns whether or not the element was added.
40func (s *OrderedSet) Add(i string) bool {
41 if _, ok := s.m[i]; ok {
42 return false
43 }
44
45 s.s = append(s.s, i)
46 s.m[i] = len(s.s) - 1
47
48 return true
49}
50
51// Contains returns whether or not the given "i" is contained in this ordered
52// set. It is a constant-time operation.

Callers 4

migrateImportCommandFunction · 0.95
trackedFromFilterFunction · 0.95
trackedFromAttrsFunction · 0.95
trackedFromExportFilterFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected