Skip to content

Commit 578609d

Browse files
committed
remove forEachLazily(BiStream, BiConsumer). Might not have enough use case.
1 parent 8b855cc commit 578609d

File tree

2 files changed

+0
-21
lines changed

2 files changed

+0
-21
lines changed

mug/src/main/java/com/google/mu/util/stream/Iteration.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -300,18 +300,6 @@ public final <K, V> Iteration<T> forEachLazily(
300300
return forEachLazily(map.entrySet(), e -> consumer.accept(e.getKey(), e.getValue()));
301301
}
302302

303-
/**
304-
* Applies {@code consumer} lazily on each pair from {@code stream}.
305-
* A pair is only iterated when consumed by the result stream.
306-
*
307-
* @since 9.6
308-
*/
309-
public final <K, V> Iteration<T> forEachLazily(
310-
BiStream<K, V> stream, BiConsumer<? super K, ? super V> consumer) {
311-
requireNonNull(consumer);
312-
return forEachLazily(stream.mapToEntry(), e -> consumer.accept(e.getKey(), e.getValue()));
313-
}
314-
315303
/**
316304
* Lazily generate into the stream the result of {@code computation}. Upon evaluation, also
317305
* passes the computation result to {@code consumer}. Useful when the

mug/src/test/java/com/google/mu/util/stream/IterationTest.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,6 @@ public class IterationTest {
5151
.inOrder();
5252
}
5353

54-
@Test public void emit_lazyPairs() {
55-
Iteration<String> iteration = new Iteration<>();
56-
assertThat(iteration.forEachLazily(
57-
BiStream.of(1, "one", 2, "two"),
58-
(k, v) -> iteration.emit(k + ":" + v)).iterate())
59-
.containsExactly("1:one", "2:two")
60-
.inOrder();
61-
}
62-
6354
@Test public void preOrder_deep() {
6455
Tree<String> tree = tree("a")
6556
.setLeft(tree("b")

0 commit comments

Comments
 (0)