ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [3/4] ignite git commit: IGNITE-2263: Optimized fold() method.
Date Wed, 30 Dec 2015 11:23:09 GMT
IGNITE-2263: Optimized fold() method.


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

Branch: refs/heads/ignite-2263
Commit: 9f02041eda6ed179872498e0385d90e8f681c4dd
Parents: 7dadfb6
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Wed Dec 30 14:19:23 2015 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Wed Dec 30 14:19:23 2015 +0300

----------------------------------------------------------------------
 .../org/apache/ignite/internal/util/lang/GridFunc.java | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/9f02041e/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
index 484ea0b..bc7252f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
@@ -3031,22 +3031,17 @@ public class GridFunc {
      *
      * @param c Input collection.
      * @param b Optional first folding pair element.
-     * @param fs Optional set of folding closures.
+     * @param fs Optional folding closure.
      * @param <D> Type of the input collection elements and type of the free variable
for the closure.
      * @param <B> Type of the folding value and return type of the closure.
      * @return Value representing folded collection.
      */
     @Nullable public static <D, B> B fold(Iterable<? extends D> c, @Nullable
B b,
-        @Nullable IgniteBiClosure<? super D, ? super B, B>... fs) {
+        IgniteBiClosure<? super D, ? super B, B> fs) {
         A.notNull(c, "c");
 
-        if (!isEmpty(fs))
-            for (D e : c) {
-                assert fs != null;
-
-                for (IgniteBiClosure<? super D, ? super B, B> f : fs)
-                    b = f.apply(e, b);
-            }
+        for (D e : c)
+            b = fs.apply(e, b);
 
         return b;
     }


Mime
View raw message