From 641569af14f9f639291f153f78b3ba467d9309e5 Mon Sep 17 00:00:00 2001 From: tomlu Date: Wed, 18 Apr 2018 08:41:55 -0700 Subject: Clean up IterablesChain. * Change builder return type to Iterable instead of IterableChain. It is over-specified and unnecessary to state the return type so precisely. * Optimize builder for cases where we add 0 or 1 iterables to the chain. In this case, we can simply return the underlying iterables without adding wrappers. * Extract DedupingIterable, it doesn't have anything to do with IterablesChain and is only used in one place RELNOTES: None PiperOrigin-RevId: 193363048 --- .../java/com/google/devtools/build/lib/collect/CollectionUtilsTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/test/java/com') diff --git a/src/test/java/com/google/devtools/build/lib/collect/CollectionUtilsTest.java b/src/test/java/com/google/devtools/build/lib/collect/CollectionUtilsTest.java index 9f8b3770a1..40d4db2cdd 100644 --- a/src/test/java/com/google/devtools/build/lib/collect/CollectionUtilsTest.java +++ b/src/test/java/com/google/devtools/build/lib/collect/CollectionUtilsTest.java @@ -64,7 +64,7 @@ public class CollectionUtilsTest { NestedSet ns2 = NestedSetBuilder.linkOrder().add(1).add(2).add(3).build(); assertThat(CollectionUtils.isImmutable(ns2)).isTrue(); - IterablesChain chain = IterablesChain.builder().addElement(1).build(); + Iterable chain = IterablesChain.builder().addElement(1).build(); assertThat(CollectionUtils.isImmutable(chain)).isTrue(); -- cgit v1.2.3