From 11fe95832ee8e2e27ff5fa3da79fde1ca4b7b995 Mon Sep 17 00:00:00 2001 From: hermens Date: Thu, 29 Dec 2005 20:01:05 +0000 Subject: [PATCH] avoid division by zero when index transfer is extremely fast git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1269 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/plasma/plasmaWordIndexDistribution.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/de/anomic/plasma/plasmaWordIndexDistribution.java b/source/de/anomic/plasma/plasmaWordIndexDistribution.java index f32409ebd..fa8220d2b 100644 --- a/source/de/anomic/plasma/plasmaWordIndexDistribution.java +++ b/source/de/anomic/plasma/plasmaWordIndexDistribution.java @@ -735,7 +735,9 @@ public final class plasmaWordIndexDistribution { } public int getTransferedEntitySpeed() { - return (int) ((1000 * transferedEntryCount) / (System.currentTimeMillis()-startingTime)); + long transferTime = System.currentTimeMillis() - startingTime; + if (transferTime <= 0) transferTime = 1; + return (int) ((1000 * transferedEntryCount) / transferTime); } public yacySeed getSeed() { @@ -929,4 +931,4 @@ public final class plasmaWordIndexDistribution { */ } -} \ No newline at end of file +}