mirror of
https://github.com/vdr-projects/vdr.git
synced 2025-03-01 10:50:46 +00:00
Implemented a hash for the channels to reduce the system load in the EIT scanning thread
This commit is contained in:
13
tools.c
13
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)];
|
||||
|
Reference in New Issue
Block a user