Implemented a hash for the channels to reduce the system load in the EIT scanning thread

This commit is contained in:
Klaus Schmidinger
2005-09-11 13:23:49 +02:00
parent 0c6ba1f928
commit 94d43abecf
7 changed files with 75 additions and 29 deletions

13
tools.c
View File

@@ -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)];