From ac72005f2f9e4cdd3e8dccc628005c5fd427272e Mon Sep 17 00:00:00 2001 From: hermens Date: Wed, 6 May 2009 12:32:34 +0000 Subject: [PATCH] Let IndexCell.remove remove entries from the ram portion of the DB as well. git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5928 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/kelondro/text/IndexCell.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/de/anomic/kelondro/text/IndexCell.java b/source/de/anomic/kelondro/text/IndexCell.java index fe3e8cd1f..4bbdcd35c 100644 --- a/source/de/anomic/kelondro/text/IndexCell.java +++ b/source/de/anomic/kelondro/text/IndexCell.java @@ -180,13 +180,15 @@ public final class IndexCell extends AbstractBu * @throws IOException */ public int remove(byte[] termHash, Set urlHashes) throws IOException { + int removed = this.ram.remove(termHash, urlHashes); int reduced = this.array.replace(termHash, new RemoveRewriter(urlHashes)); - return reduced / this.array.rowdef().objectsize; + return removed + (reduced / this.array.rowdef().objectsize); } public boolean remove(byte[] termHash, String urlHash) throws IOException { + boolean removed = this.ram.remove(termHash, urlHash); int reduced = this.array.replace(termHash, new RemoveRewriter(urlHash)); - return reduced > 0; + return removed || (reduced > 0); } private static class RemoveRewriter implements ReferenceContainerArray.ContainerRewriter {