/*
- * $Id: reclists.c,v 1.2 2006-11-26 05:15:43 quinn Exp $
+ * $Id: reclists.c,v 1.4 2006-12-08 21:40:58 quinn Exp $
*/
#include <assert.h>
struct reclist_bucket **p;
struct record *head;
- bucket = hash(record->merge_key) & l->hashmask;
+ bucket = hash((unsigned char*) record->merge_key) & l->hashmask;
for (p = &l->hashtable[bucket]; *p; p = &(*p)->next)
{
// We found a matching record. Merge them
if (!strcmp(record->merge_key, (*p)->record->merge_key))
{
struct record *existing = (*p)->record;
- yaz_log(YLOG_LOG, "Found a matching record: %s", record->merge_key);
record->next_cluster = existing->next_cluster;
existing->next_cluster = record;
head = existing;
}
if (!*p) // We made it to the end of the bucket without finding match
{
- yaz_log(YLOG_DEBUG, "Added a new record: %s", record->merge_key);
struct reclist_bucket *new = nmem_malloc(l->nmem,
sizeof(struct reclist_bucket));
new->record = record;