Skip to content

Commit

Permalink
Don't throw away visit result in BasePlanProtoVisitor
Browse files Browse the repository at this point in the history
`visitPlan` is marked `protected`, meaning that non-subclasses of `BasePlanProtoVisitor` (which is probably what'll initiate the `visit` most of the time) cannot have access to the `visit` result.

Is there a specific reason that the traversal result has been hidden? If not, i suggest this change.

If so, subclasses are obviously free to implement a `visitWithResult` function to do the same thing.
  • Loading branch information
mortbopet committed Sep 7, 2024
1 parent 94ff855 commit e967b33
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/substrait/textplan/converter/BasePlanProtoVisitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ class BasePlanProtoVisitor {
BasePlanProtoVisitor() = default;

// visit() begins the traversal of the entire plan.
virtual void visit(const ::substrait::proto::Plan& plan) {
visitPlan(plan);
virtual std::any visit(const ::substrait::proto::Plan& plan) {
return visitPlan(plan);
}

protected:
Expand Down

0 comments on commit e967b33

Please sign in to comment.