MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / Filter

Method Filter

xmlparser/attributes.go:125–133  ·  view source on GitHub ↗

Filter removes all attributes that do not satisfy the predicate function.

(pred func(*Attribute) bool)

Source from the content-addressed store, hash-verified

123
124// Filter removes all attributes that do not satisfy the predicate function.
125func (a *Attributes) Filter(pred func(*Attribute) bool) {
126 a.s = slices.DeleteFunc(a.s, func(attr *Attribute) bool {
127 del := !pred(attr)
128 if del {
129 delete(a.m, attr.Name)
130 }
131 return del
132 })
133}
134
135// Sort sorts the attributes according to the provided function.
136func (a *Attributes) Sort(cmp func(i, j *Attribute) int) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected