MCPcopy
hub / github.com/ory/kratos / RemoveMatching

Method RemoveMatching

ui/node/node.go:417–430  ·  view source on GitHub ↗
(node *Node)

Source from the content-addressed store, hash-verified

415}
416
417func (n *Nodes) RemoveMatching(node *Node) {
418 if n == nil {
419 return
420 }
421
422 r := Nodes{}
423 for k, v := range *n {
424 if !(*n)[k].Matches(node) {
425 r = append(r, v)
426 }
427 }
428
429 *n = r
430}
431
432func (n *Node) Matches(needle *Node) bool {
433 if len(needle.ID()) > 0 && n.ID() != needle.ID() {

Calls 1

MatchesMethod · 0.65

Tested by 1

TestRemoveMatchingNodesFunction · 0.76