just some comment lines

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6081 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 16 years ago
parent 31f60a3b3e
commit 5a7fd6b4c8

@ -491,14 +491,20 @@ public class EcoTable implements ObjectIndex {
assert i < index.size();
if (table == null) {
if (i == index.size() - 1) {
// element is at last entry position
ix = (int) index.remove(key);
assert ix == i;
file.cleanLast(b, 0);
} else {
// remove entry from index
assert i < index.size() - 1;
ix = (int) index.remove(key);
assert ix == i;
// read element that shall be removed
file.get(i, b, 0);
// fill the gap with value from last entry in file
file.cleanLast(p, 0);
file.put(i, p, 0);
final byte[] k = new byte[rowdef.primaryKeyLength];
@ -519,15 +525,20 @@ public class EcoTable implements ObjectIndex {
table.removeRow(i, false);
file.cleanLast();
} else {
// switch values
// remove entry from index
ix = (int) index.remove(key);
assert ix == i;
// switch values:
// remove last entry from the file copy to fill it in the gap
final Row.Entry te = table.removeOne();
// fill the gap in file copy
table.set(i, te);
// move entry from last entry in file to gap position
file.cleanLast(p, 0);
file.put(i, p, 0);
// set new index for moved entry in index
final Row.Entry lr = rowdef.newEntry(p);
index.put(lr.getPrimaryKeyBytes(), i);
}

Loading…
Cancel
Save