lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nwelln...@apache.org
Subject [3/3] lucy-clownfish git commit: Reset threshold after clearing Hash
Date Wed, 15 Apr 2015 13:24:35 GMT
Reset threshold after clearing Hash

The old behavior could lead to premature resizing of hash tables after a
Clear operation.


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/93f0dee1
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/93f0dee1
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/93f0dee1

Branch: refs/heads/master
Commit: 93f0dee1f8c8e9ff8cb5f576ff71b4c0d0470594
Parents: 0b74633
Author: Nick Wellnhofer <wellnhofer@aevum.de>
Authored: Tue Apr 14 12:59:57 2015 +0200
Committer: Nick Wellnhofer <wellnhofer@aevum.de>
Committed: Wed Apr 15 15:22:09 2015 +0200

----------------------------------------------------------------------
 runtime/core/Clownfish/Hash.c | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/93f0dee1/runtime/core/Clownfish/Hash.c
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Hash.c b/runtime/core/Clownfish/Hash.c
index 7a4a450..c46b9ea 100644
--- a/runtime/core/Clownfish/Hash.c
+++ b/runtime/core/Clownfish/Hash.c
@@ -112,6 +112,8 @@ Hash_Clear_IMP(Hash *self) {
     }
 
     self->size = 0;
+    // All tombstones were removed, reset threshold.
+    self->threshold = (self->capacity / 3) * 2;
 }
 
 void


Mime
View raw message