Martin Mucha has posted comments on this change.

Change subject: core: util for removing overlaps in ranges
......................................................................


Patch Set 6:

(1 comment)

answers.

http://gerrit.ovirt.org/#/c/26403/6/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 12:     private LinkedList<Pair<Long, Long>> result = new LinkedList<>();
Line 13: 
Line 14: 
Line 15:     public static List<Pair<Long, Long>> 
removePotentialOverlaps(LinkedList<Pair<Long, Long>> pairs) {
Line 16:         if (pairs.isEmpty()) {
> You know how the saying goes "premature optimization is the root of all evi
Would you call using quicksort instead of bubble sort a premature optimization? 
I hope not.
this is not premature optimization. This is extremely simple naive 
implementation with simple check. Optimization is process you spend time on it 
making things run better to some degree. This was written in 5s. I did spend 
more time defending better solution against misinterpreted maxim, than I spend 
on writing it. But done.
Line 17:             return Collections.emptyList();
Line 18:         }
Line 19: 
Line 20:         RangesWithoutOverlaps rwo = new RangesWithoutOverlaps();


-- 
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: 6
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Martin Mucha <[email protected]>
Gerrit-Reviewer: Martin Mucha <[email protected]>
Gerrit-Reviewer: Mike Kolesnik <[email protected]>
Gerrit-Reviewer: Moti Asayag <[email protected]>
Gerrit-Reviewer: Yevgeny Zaspitsky <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to