MCPcopy Create free account
hub / github.com/docopt/docopt.go / unique

Method unique

docopt.go:1145–1155  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1143}
1144
1145func (pl patternList) unique() patternList {
1146 table := make(map[string]bool)
1147 result := patternList{}
1148 for _, v := range pl {
1149 if !table[v.String()] {
1150 table[v.String()] = true
1151 result = append(result, v)
1152 }
1153 }
1154 return result
1155}
1156
1157func (pl patternList) index(p *pattern) (int, error) {
1158 for i, c := range pl {

Callers 3

TestSetFunction · 0.95
parseFunction · 0.80
fixIdentitiesMethod · 0.80

Calls 1

StringMethod · 0.45

Tested by 1

TestSetFunction · 0.76