ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ag...@apache.org
Subject [05/11] ignite git commit: ignite-3682: fix FlatIterator
Date Wed, 12 Apr 2017 15:58:02 GMT
ignite-3682: fix FlatIterator


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

Branch: refs/heads/master
Commit: b2441db0d75e26946c751cb6a4eaa2a2d2eb1e4a
Parents: a3f845b
Author: daradurvs <daradurvs@gmail.com>
Authored: Fri Mar 31 22:26:23 2017 +0300
Committer: agura <agura@apache.org>
Committed: Mon Apr 10 19:39:06 2017 +0300

----------------------------------------------------------------------
 .../ignite/internal/util/lang/gridfunc/FlatIterator.java  | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/b2441db0/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/FlatIterator.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/FlatIterator.java
b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/FlatIterator.java
index d890e32..1b1491e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/FlatIterator.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/FlatIterator.java
@@ -63,10 +63,12 @@ public class FlatIterator<T> extends GridIteratorAdapter<T>
{
             return more = true;
 
         while (iter.hasNext()) {
-            if (iter instanceof Iterable)
-                next = (Iterator)((Iterable)iter).iterator().next();
-            else if (iter instanceof Iterator)
-                next = (Iterator)((Iterator)iter).next();
+            Object obj = iter.next();
+
+            if (obj instanceof Iterable)
+                next = ((Iterable)obj).iterator();
+            else if (obj instanceof Iterator)
+                next = (Iterator)obj;
             else
                 assert false : "Iterable or Iterator are expected";
 


Mime
View raw message