We are just transferring entries here, so let's reuse the single object
and clear() after each pass.
JIRA: MDSAL-669
Change-Id: Ie41ba63087c8ad0fdc5a581a7d7c4c8dc77f8677
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
// Secondary passes: if any unprocessed groupings have been marked as used, process their children, potentially
// adding more work
+ final var found = new HashSet<GroupingGenerator>();
int passes = 2;
int processed;
do {
// Do not process groupings again unless we make some progress
processed = 0;
- final var found = new HashSet<GroupingGenerator>();
final var it = remaining.iterator();
while (it.hasNext()) {
final var next = it.next();
if (foundSize != 0) {
// we have some more groupings to process, shove them into the next iteration
remaining.addAll(found);
+ remaining.clear();
}
passes++;