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

Function NewOrderedSetWithCapacity

tools/ordered_set.go:20–25  ·  view source on GitHub ↗

NewOrderedSetWithCapacity creates a new ordered set with no values. The returned ordered set can be appended to "capacity" number of times before it grows internally.

(capacity int)

Source from the content-addressed store, hash-verified

18// returned ordered set can be appended to "capacity" number of times before it
19// grows internally.
20func NewOrderedSetWithCapacity(capacity int) *OrderedSet {
21 return &OrderedSet{
22 s: make([]string, 0, capacity),
23 m: make(map[string]int, capacity),
24 }
25}
26
27// NewOrderedSetFromSlice returns a new ordered set with the elements given in
28// the slice "s".

Callers 6

NewOrderedSetFunction · 0.85
NewOrderedSetFromSliceFunction · 0.85
UnionMethod · 0.85
IntersectMethod · 0.85
DifferenceMethod · 0.85
CloneMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected