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

Method diff

docopt.go:1176–1196  ·  view source on GitHub ↗
(l patternList)

Source from the content-addressed store, hash-verified

1174}
1175
1176func (pl patternList) diff(l patternList) patternList {
1177 lAlt := make(patternList, len(l))
1178 copy(lAlt, l)
1179 result := make(patternList, 0, len(pl))
1180 for _, v := range pl {
1181 if v != nil {
1182 match := false
1183 for i, w := range lAlt {
1184 if w.eq(v) {
1185 match = true
1186 lAlt[i] = nil
1187 break
1188 }
1189 }
1190 if match == false {
1191 result = append(result, v)
1192 }
1193 }
1194 }
1195 return result
1196}
1197
1198func (pl patternList) double() patternList {
1199 l := len(pl)

Callers 2

removeMethod · 0.95
parseFunction · 0.80

Calls 1

eqMethod · 0.45

Tested by

no test coverage detected