Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion android/guava/src/com/google/common/collect/Iterables.java
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,9 @@ public Iterator<T> iterator() {
checkNotNull(iterable);
return (iterable instanceof List)
? ((List<T>) iterable).get(position)
: Iterators.get(iterable.iterator(), position);
: ((iterable instanceof ImmutableCollection)
? ((ImmutableCollection<T>)iterable).asList().get(position)
: Iterators.get(iterable.iterator(), position));
}

/**
Expand Down
4 changes: 3 additions & 1 deletion guava/src/com/google/common/collect/Iterables.java
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,9 @@ public Spliterator<T> spliterator() {
checkNotNull(iterable);
return (iterable instanceof List)
? ((List<T>) iterable).get(position)
: Iterators.get(iterable.iterator(), position);
: ((iterable instanceof ImmutableCollection)
? ((ImmutableCollection<T>)iterable).asList().get(position)
: Iterators.get(iterable.iterator(), position));
}

/**
Expand Down