Try not to loose content from ram during IndexCell.delete by moving ram.delete after the dangerous operations on the array (array.get and array.delete)

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5929 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
hermens 16 years ago
parent ac72005f2f
commit df733af4fa

@ -160,14 +160,11 @@ public final class IndexCell<ReferenceType extends Reference> extends AbstractBu
* @throws IOException
*/
public ReferenceContainer<ReferenceType> delete(byte[] termHash) throws IOException {
ReferenceContainer<ReferenceType> c0 = this.ram.delete(termHash);
ReferenceContainer<ReferenceType> c1 = this.array.get(termHash);
if (c1 == null) {
if (c0 == null) return null;
return c0;
}
this.array.delete(termHash);
if (c1 != null) this.array.delete(termHash);
ReferenceContainer<ReferenceType> c0 = this.ram.delete(termHash);
cleanCache();
if (c1 == null) return c0;
if (c0 == null) return c1;
return c1.merge(c0);
}

Loading…
Cancel
Save