Moti Asayag has posted comments on this change. Change subject: core: util for removing overlaps in ranges ......................................................................
Patch Set 5: (3 comments) http://gerrit.ovirt.org/#/c/26403/5/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/RangesWithoutOverlaps.java File backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/RangesWithoutOverlaps.java: Line 6: import java.util.ListIterator; Line 7: Line 8: import org.ovirt.engine.core.common.utils.Pair; Line 9: Line 10: public class RangesWithoutOverlaps { perhaps DisjointRanges ? Line 11: Line 12: private LinkedList<Pair<Long, Long>> result = new LinkedList<>(); Line 13: Line 14: Line 12: result s/result/disjointRanges ? Line 37: throw new IllegalArgumentException("badly defined range"); Line 38: } Line 39: Line 40: for(int i = 0; i < result.size(); i++) { Line 41: Pair<Long, Long> existingRange = result.get(i); Using org.apache.commons.lang.math.LongRange will save you most of this method's code. Also, you could use it instead of Pair<Long, Long> result (or any other place where this type is needed) Line 42: long existingLeft = existingRange.getFirst(); Line 43: long existingRight = existingRange.getSecond(); Line 44: Line 45: -- To view, visit http://gerrit.ovirt.org/26403 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id7dbacd11b610a5885d574356a695c6e879dcdbc Gerrit-PatchSet: 5 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Martin Mucha <mmu...@redhat.com> Gerrit-Reviewer: Martin Mucha <mmu...@redhat.com> Gerrit-Reviewer: Moti Asayag <masa...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches