MCPcopy Create free account
hub / github.com/github/gh-aw / nodesEqual

Function nodesEqual

pkg/workflow/expression_optimizer.go:106–111  ·  view source on GitHub ↗

nodesEqual returns true when a and b render to identical strings. This is used as a conservative structural-equality test: if two nodes render identically they are semantically equivalent in the expression.

(a, b ConditionNode)

Source from the content-addressed store, hash-verified

104// This is used as a conservative structural-equality test: if two nodes
105// render identically they are semantically equivalent in the expression.
106func nodesEqual(a, b ConditionNode) bool {
107 if a == nil || b == nil {
108 return a == nil && b == nil
109 }
110 return a.Render() == b.Render()
111}
112
113// isNegationOf returns true when b is the logical negation of a or a is the
114// logical negation of b (handles both A / !A and !A / A cases).

Callers 5

isNegationOfFunction · 0.85
termSubsumedByFunction · 0.85
optimizeAndNodeFunction · 0.85
optimizeOrNodeFunction · 0.85
TestNodesEqualFunction · 0.85

Calls 1

RenderMethod · 0.65

Tested by 1

TestNodesEqualFunction · 0.68