aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Janak Ramakrishnan <janakr@google.com>2016-03-07 18:18:56 +0000
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2016-03-08 03:44:47 +0000
commit4367a54b427649318b2b3c2828b6f61104023ea9 (patch)
treefe882b3dfd8af7f15755172c32c99f6049f65bb3
parent6c498c37c4160bd97abc988ca97b36c9b9d7e1f0 (diff)
Use a list instead of a set for the current group in GroupedListHelper to save memory. This is a partial rollback of f745e99db7632cfb2145b6926f961e85f9084bc5, but that part of the change was unnecessary -- we are already ensuring that an element isn't added twice in GroupedListHelper#add by adding it to elements.
-- MOS_MIGRATED_REVID=116560479
-rw-r--r--src/main/java/com/google/devtools/build/lib/util/GroupedList.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/util/GroupedList.java b/src/main/java/com/google/devtools/build/lib/util/GroupedList.java
index cd633b8580..09674d4cef 100644
--- a/src/main/java/com/google/devtools/build/lib/util/GroupedList.java
+++ b/src/main/java/com/google/devtools/build/lib/util/GroupedList.java
@@ -312,7 +312,7 @@ public class GroupedList<T> implements Iterable<Collection<T>> {
public static class GroupedListHelper<E> implements Iterable<E> {
// Non-final only for removal.
private List<Object> groupedList;
- private CompactHashSet<E> currentGroup = null;
+ private List<E> currentGroup = null;
private final CompactHashSet<E> elements;
public GroupedListHelper() {
@@ -361,7 +361,7 @@ public class GroupedList<T> implements Iterable<Collection<T>> {
*/
public void startGroup() {
Preconditions.checkState(currentGroup == null, this);
- currentGroup = CompactHashSet.create();
+ currentGroup = new ArrayList<>();
}
/** Ends a group started with {@link #startGroup}. */