MCPcopy
hub / github.com/google/go-cmp / stats

Method stats

cmp/internal/diff/diff.go:62–78  ·  view source on GitHub ↗

stats returns a histogram of the number of each type of edit operation.

()

Source from the content-addressed store, hash-verified

60
61// stats returns a histogram of the number of each type of edit operation.
62func (es EditScript) stats() (s struct{ NI, NX, NY, NM int }) {
63 for _, e := range es {
64 switch e {
65 case Identity:
66 s.NI++
67 case UniqueX:
68 s.NX++
69 case UniqueY:
70 s.NY++
71 case Modified:
72 s.NM++
73 default:
74 panic("invalid edit-type")
75 }
76 }
77 return
78}
79
80// Dist is the Levenshtein distance and is guaranteed to be 0 if and only if
81// lists X and Y are equal.

Callers 3

DistMethod · 0.95
LenXMethod · 0.95
LenYMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected