summaryrefslogtreecommitdiff
path: root/tools.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2005-09-11 13:23:49 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2005-09-11 13:23:49 +0200
commit94d43abecf01f203d9dc476c09717abbc3f34664 (patch)
tree705e5f9a19f2747d1e706526485715c2e57ddca3 /tools.c
parent0c6ba1f9287584b2da1ee80ff8dcd0042f0ded46 (diff)
downloadvdr-94d43abecf01f203d9dc476c09717abbc3f34664.tar.gz
vdr-94d43abecf01f203d9dc476c09717abbc3f34664.tar.bz2
Implemented a hash for the channels to reduce the system load in the EIT scanning thread1.3.32
Diffstat (limited to 'tools.c')
-rw-r--r--tools.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/tools.c b/tools.c
index 46d3ce26..28b2bbed 100644
--- a/tools.c
+++ b/tools.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: tools.c 1.97 2005/08/27 14:43:55 kls Exp $
+ * $Id: tools.c 1.98 2005/09/11 13:11:05 kls Exp $
*/
#include "tools.h"
@@ -1080,8 +1080,7 @@ cHashBase::cHashBase(int Size)
cHashBase::~cHashBase(void)
{
- for (int i = 0; i < size; i++)
- delete hashTable[i];
+ Clear();
free(hashTable);
}
@@ -1106,6 +1105,14 @@ void cHashBase::Del(cListObject *Object, unsigned int Id)
}
}
+void cHashBase::Clear(void)
+{
+ for (int i = 0; i < size; i++) {
+ delete hashTable[i];
+ hashTable[i] = NULL;
+ }
+}
+
cListObject *cHashBase::Get(unsigned int Id) const
{
cList<cHashObject> *list = hashTable[hashfn(Id)];