This is an automated email from the ASF dual-hosted git repository.
amaliujia pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/calcite.git
The following commit(s) were added to refs/heads/master by this push:
new d21d540 [CALCITE-4426] Short-circuit evaluating when comparing two
"RelTraitSet"s (Jiatao Tao)
d21d540 is described below
commit d21d540fafce8225b12b032900a8087f8ac33a91
Author: Jiatao Tao <[email protected]>
AuthorDate: Fri Dec 4 16:32:56 2020 +0800
[CALCITE-4426] Short-circuit evaluating when comparing two "RelTraitSet"s
(Jiatao Tao)
---
core/src/main/java/org/apache/calcite/plan/RelTraitSet.java | 3 +++
1 file changed, 3 insertions(+)
diff --git a/core/src/main/java/org/apache/calcite/plan/RelTraitSet.java
b/core/src/main/java/org/apache/calcite/plan/RelTraitSet.java
index e7a65dc..955d0e9 100644
--- a/core/src/main/java/org/apache/calcite/plan/RelTraitSet.java
+++ b/core/src/main/java/org/apache/calcite/plan/RelTraitSet.java
@@ -483,6 +483,9 @@ public final class RelTraitSet extends
AbstractList<RelTrait> {
* @see org.apache.calcite.plan.RelTrait#satisfies(RelTrait)
*/
public boolean satisfies(RelTraitSet that) {
+ if (this == that) {
+ return true;
+ }
final int n =
Math.min(
this.size(),