[mlpack-git] master: Simplify the code. (dce67ec)

gitdub at mlpack.org gitdub at mlpack.org
Tue Aug 16 16:30:33 EDT 2016


Repository : https://github.com/mlpack/mlpack
On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/0f4b25acd6aaa14294c044874ba6cc0751712baa...0a19d07bd39e6223991976474bc79671ba8aa0f0

>---------------------------------------------------------------

commit dce67ec82adedd7be4c113eea7dec95385f755aa
Author: MarcosPividori <marcos.pividori at gmail.com>
Date:   Tue Aug 16 17:30:33 2016 -0300

    Simplify the code.


>---------------------------------------------------------------

dce67ec82adedd7be4c113eea7dec95385f755aa
 src/mlpack/core/tree/spill_tree/spill_tree_impl.hpp | 20 ++++----------------
 1 file changed, 4 insertions(+), 16 deletions(-)

diff --git a/src/mlpack/core/tree/spill_tree/spill_tree_impl.hpp b/src/mlpack/core/tree/spill_tree/spill_tree_impl.hpp
index c677ef2..29ef325 100644
--- a/src/mlpack/core/tree/spill_tree/spill_tree_impl.hpp
+++ b/src/mlpack/core/tree/spill_tree/spill_tree_impl.hpp
@@ -613,15 +613,9 @@ bool SpillTree<MetricType, StatisticType, MatType, HyperplaneType, SplitType>::
     for (size_t i = 0, rc = 0, lc = 0; i < points.n_elem; i++)
     {
       if (projections[i] < tau || projections[i] <= 0)
-      {
-        leftPoints[lc] = points[i];
-        lc++;
-      }
+        leftPoints[lc++] = points[i];
       if (projections[i] > -tau)
-      {
-        rightPoints[rc] = points[i];
-        rc++;
-      }
+        rightPoints[rc++] = points[i];
     }
     // Return true, because it is a overlapping node.
     return true;
@@ -636,15 +630,9 @@ bool SpillTree<MetricType, StatisticType, MatType, HyperplaneType, SplitType>::
   for (size_t i = 0, rc = 0, lc = 0; i < points.n_elem; i++)
   {
     if (projections[i] <= 0)
-    {
-      leftPoints[lc] = points[i];
-      lc++;
-    }
+      leftPoints[lc++] = points[i];
     else
-    {
-      rightPoints[rc] = points[i];
-      rc++;
-    }
+      rightPoints[rc++] = points[i];
   }
   // Return false, because it isn't a overlapping node.
   return false;




More information about the mlpack-git mailing list