no more strict comparator checking in map exclude method if not needed

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1901 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 19 years ago
parent 0b903c5317
commit 9cca36a107

@ -222,9 +222,8 @@ public class kelondroMSetTools {
// comparators must be equal
if (map == null) return null;
if (set == null) return map;
if (map.comparator() != set.comparator()) return null;
if ((map.size() == 0) || (set.size() == 0)) return map;
if (map.comparator() != set.comparator()) return excludeConstructiveByTestMapInSet(map, set);
return excludeConstructiveByTestMapInSet(map, set);
// return excludeConstructiveByEnumeration(map, set);
}
@ -255,12 +254,16 @@ public class kelondroMSetTools {
c = compare(mobj, sobj, comp);
if (c < 0) {
result.put(mobj, map.get(mobj));
if (mi.hasNext()) mobj = mi.next(); else break;
if (mi.hasNext()) mobj = mi.next();
else break;
} else if (c > 0) {
if (si.hasNext()) sobj = si.next(); else break;
if (si.hasNext()) sobj = si.next();
else break;
} else {
if (mi.hasNext()) mobj = mi.next(); else break;
if (si.hasNext()) sobj = si.next(); else {
if (mi.hasNext()) mobj = mi.next();
else break;
if (si.hasNext()) sobj = si.next();
else {
// final flush
result.put(mobj, map.get(mobj));
while (mi.hasNext()) {

Loading…
Cancel
Save