Skip to content

Commit

Permalink
Reduced the number of type checks
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaochen-zhou authored and mihaibudiu committed Nov 7, 2024
1 parent 7865c86 commit 50d1a26
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -421,14 +421,14 @@ protected void registerMaterializations() {
return false;
}

final boolean isTransFormRule = rule instanceof TransformationRule;
// Each of this rule's operands is an 'entry point' for a rule call.
// Register each operand against all concrete sub-classes that could match
// it.
for (RelOptRuleOperand operand : rule.getOperands()) {
for (Class<? extends RelNode> subClass
: subClasses(operand.getMatchedClass())) {
if (PhysicalNode.class.isAssignableFrom(subClass)
&& rule instanceof TransformationRule) {
if (isTransFormRule && PhysicalNode.class.isAssignableFrom(subClass)) {
continue;
}
classOperands.put(subClass, operand);
Expand Down

0 comments on commit 50d1a26

Please sign in to comment.