Ahh yes, good! I'll fix. Mike McCandless
http://blog.mikemccandless.com On Sun, Jun 19, 2011 at 6:39 AM, Uwe Schindler <[email protected]> wrote: > Just for curiosity: > >> @@ -93,14 +94,16 @@ public class UpgradeIndexMergePolicy ext >> if (oldSegments.isEmpty()) >> return null; >> >> - MergeSpecification spec = base.findMergesForOptimize(segmentInfos, >> maxSegmentCount, oldSegments); >> + MergeSpecification spec = base.findMergesForOptimize(segmentInfos, >> + maxSegmentCount, oldSegments); >> >> if (spec != null) { >> // remove all segments that are in merge specification from >> oldSegments, >> // the resulting set contains all segments that are left over >> // and will be merged to one additional segment: >> for (final OneMerge om : spec.merges) { >> - oldSegments.removeAll(om.segments); >> + for(SegmentInfo info : om.segments) { >> + oldSegments.remove(info); >> + } >> } >> } > > This can be simply be optimized by using views: > > oldSegments.keySet().removeAll(om.segments); > > Uwe > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
