Skip to content

Commit

Permalink
(#1169) Use casting instead of `Mapped'
Browse files Browse the repository at this point in the history
  • Loading branch information
andreoss committed Oct 20, 2020
1 parent 35e6023 commit 9d3b021
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/org/cactoos/iterable/Synced.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,11 @@ public Synced(final Object lck, final Iterable<? extends X> iterable) {
this.lock = lck;
}

@SuppressWarnings("unchecked")
@Override
public Iterator<X> iterator() {
synchronized (this.lock) {
return new Mapped<>(x -> x, this.origin.iterator());
return (Iterator<X>) this.origin.iterator();
}
}
}

0 comments on commit 9d3b021

Please sign in to comment.