MCPcopy Create free account
hub / github.com/araddon/qlbridge / Collapse

Method Collapse

expr/node.go:1452–1466  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1450 io.WriteString(w, " )")
1451}
1452func (m *BooleanNode) Collapse() Node {
1453 if len(m.Args) == 1 {
1454 if m.Negated() {
1455 nn, ok := m.Args[0].(NegateableNode)
1456 if ok {
1457 if nn.ReverseNegation() {
1458 return nn
1459 }
1460 }
1461 return NewUnary(m.Operator, m.Args[0])
1462 }
1463 return m.Args[0]
1464 }
1465 return m
1466}
1467func (m *BooleanNode) Negated() bool { return m.negated }
1468func (m *BooleanNode) Validate() error {
1469 for _, n := range m.Args {

Callers 1

FMethod · 0.95

Calls 3

NegatedMethod · 0.95
NewUnaryFunction · 0.85
ReverseNegationMethod · 0.65

Tested by

no test coverage detected