You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by rx...@apache.org on 2014/05/26 23:35:02 UTC

git commit: SPARK-1925: Replace '&' with '&&'

Repository: spark
Updated Branches:
  refs/heads/master bee6c4f4a -> cb7fe5034


SPARK-1925: Replace '&' with '&&'

JIRA: https://issues.apache.org/jira/browse/SPARK-1925

Author: zsxwing <zs...@gmail.com>

Closes #879 from zsxwing/SPARK-1925 and squashes the following commits:

5cf5a6d [zsxwing] SPARK-1925: Replace '&' with '&&'


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/cb7fe503
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/cb7fe503
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/cb7fe503

Branch: refs/heads/master
Commit: cb7fe5034826844f1b50fbe8b92646317b66f21c
Parents: bee6c4f
Author: zsxwing <zs...@gmail.com>
Authored: Mon May 26 14:34:58 2014 -0700
Committer: Reynold Xin <rx...@apache.org>
Committed: Mon May 26 14:34:58 2014 -0700

----------------------------------------------------------------------
 .../main/scala/org/apache/spark/mllib/tree/DecisionTree.scala    | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/cb7fe503/mllib/src/main/scala/org/apache/spark/mllib/tree/DecisionTree.scala
----------------------------------------------------------------------
diff --git a/mllib/src/main/scala/org/apache/spark/mllib/tree/DecisionTree.scala b/mllib/src/main/scala/org/apache/spark/mllib/tree/DecisionTree.scala
index 0fe30a3..3b13e52 100644
--- a/mllib/src/main/scala/org/apache/spark/mllib/tree/DecisionTree.scala
+++ b/mllib/src/main/scala/org/apache/spark/mllib/tree/DecisionTree.scala
@@ -401,7 +401,7 @@ object DecisionTree extends Serializable with Logging {
      */
     def isSampleValid(parentFilters: List[Filter], labeledPoint: LabeledPoint): Boolean = {
       // leaf
-      if ((level > 0) & (parentFilters.length == 0)) {
+      if ((level > 0) && (parentFilters.length == 0)) {
         return false
       }
 
@@ -454,7 +454,7 @@ object DecisionTree extends Serializable with Logging {
           val bin = binForFeatures(mid)
           val lowThreshold = bin.lowSplit.threshold
           val highThreshold = bin.highSplit.threshold
-          if ((lowThreshold < feature) & (highThreshold >= feature)){
+          if ((lowThreshold < feature) && (highThreshold >= feature)){
             return mid
           }
           else if (lowThreshold >= feature) {