MCPcopy
hub / github.com/fogleman/ln / Filter

Method Filter

ln/path.go:49–68  ·  view source on GitHub ↗
(f Filter)

Source from the content-addressed store, hash-verified

47}
48
49func (p Path) Filter(f Filter) Paths {
50 var result Paths
51 var path Path
52 for _, v := range p {
53 v, ok := f.Filter(v)
54 // ok = ok || i%8 < 4 // show hidden lines
55 if ok {
56 path = append(path, v)
57 } else {
58 if len(path) > 1 {
59 result = append(result, path)
60 }
61 path = nil
62 }
63 }
64 if len(path) > 1 {
65 result = append(result, path)
66 }
67 return result
68}
69
70func (p Path) Simplify(threshold float64) Path {
71 if len(p) < 3 {

Callers

nothing calls this directly

Calls 1

FilterMethod · 0.65

Tested by

no test coverage detected