Skip to content
Snippets Groups Projects

reduce commit/diff queries on construction

Merged Administrator requested to merge cc/reduce-on-construction into main

Created by: camdencheek

This commit takes a stab at reducing commit/diff query trees during construction.

In response to Rijnard's comment

  • It adds NewAnd, NewOr, NewNot, and NewOperator
  • It reduces And() to &Constant{true} and Or() to &Constant{false}
  • It reduces And(x) and Or(x) to x
  • It reduces And(And(x), y) to And(x, y) and Or(x, Or(y)) to Or(x, y)
  • It reduces Not(Not(x)) to x

This does some basic minimization during query construction to keep from generating deeply nested trees, but does not do any additional optimization passes. Those will be coming in a followup PR as a separate step.

Merge request reports

Merged by avatar (Jul 6, 2025 6:20am UTC)

Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading