Skip to content

Commit 6eed482

Browse files
committed
In DecisionTree: Changed from using procedural syntax for functions returning Unit to explicitly writing Unit return type.
1 parent 376dca2 commit 6eed482

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

mllib/src/main/scala/org/apache/spark/mllib/tree/DecisionTree.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ object DecisionTree extends Serializable with Logging {
606606
agg: Array[Double],
607607
nodeIndex: Int,
608608
label: Double,
609-
featureIndex: Int) = {
609+
featureIndex: Int): Unit = {
610610
// Find the bin index for this feature.
611611
val arrShift = 1 + numFeatures * nodeIndex
612612
val arrIndex = arrShift + featureIndex
@@ -624,7 +624,7 @@ object DecisionTree extends Serializable with Logging {
624624
arr: Array[Double],
625625
label: Double,
626626
agg: Array[Double],
627-
rightChildShift: Int) = {
627+
rightChildShift: Int): Unit = {
628628
// Find the bin index for this feature.
629629
val arrIndex = 1 + numFeatures * nodeIndex + featureIndex
630630
val featureValue = arr(arrIndex).toInt
@@ -659,7 +659,7 @@ object DecisionTree extends Serializable with Logging {
659659
* @return Array[Double] storing aggregate calculation of size
660660
* 2 * numSplits * numFeatures * numNodes for classification
661661
*/
662-
def orderedClassificationBinSeqOp(arr: Array[Double], agg: Array[Double]) = {
662+
def orderedClassificationBinSeqOp(arr: Array[Double], agg: Array[Double]): Unit = {
663663
// Iterate over all nodes.
664664
var nodeIndex = 0
665665
while (nodeIndex < numNodes) {
@@ -691,7 +691,7 @@ object DecisionTree extends Serializable with Logging {
691691
* @return Array[Double] storing aggregate calculation of size
692692
* 2 * numClasses * numSplits * numFeatures * numNodes for classification
693693
*/
694-
def unorderedClassificationBinSeqOp(arr: Array[Double], agg: Array[Double]) = {
694+
def unorderedClassificationBinSeqOp(arr: Array[Double], agg: Array[Double]): Unit = {
695695
// Iterate over all nodes.
696696
var nodeIndex = 0
697697
while (nodeIndex < numNodes) {
@@ -736,7 +736,7 @@ object DecisionTree extends Serializable with Logging {
736736
* @return Array[Double] storing aggregate calculation of size
737737
* 3 * numSplits * numFeatures * numNodes for regression
738738
*/
739-
def regressionBinSeqOp(arr: Array[Double], agg: Array[Double]) = {
739+
def regressionBinSeqOp(arr: Array[Double], agg: Array[Double]): Unit = {
740740
// Iterate over all nodes.
741741
var nodeIndex = 0
742742
while (nodeIndex < numNodes) {

0 commit comments

Comments
 (0)