CopyPredicate creates a copy of the input predicate.
(p *Predicate)
| 9 | |
| 10 | // CopyPredicate creates a copy of the input predicate. |
| 11 | func CopyPredicate(p *Predicate) *Predicate { |
| 12 | if p == nil { |
| 13 | return nil |
| 14 | } |
| 15 | |
| 16 | c := &Predicate{} |
| 17 | c.Name = p.Name |
| 18 | c.Args = copyArgs(p.Args) |
| 19 | return c |
| 20 | } |
| 21 | |
| 22 | // CopyPredicates creates a new slice with the copy of each predicate in the input slice. |
| 23 | func CopyPredicates(p []*Predicate) []*Predicate { |