projects
/
pazpar2-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Do not use deprecated ICU definitions
[pazpar2-moved-to-github.git]
/
src
/
reclists.c
diff --git
a/src/reclists.c
b/src/reclists.c
index
1b43169
..
5afd057
100644
(file)
--- a/
src/reclists.c
+++ b/
src/reclists.c
@@
-1,5
+1,5
@@
/* This file is part of Pazpar2.
/* This file is part of Pazpar2.
- Copyright (C) 2006-2013 Index Data
+ Copyright (C) Index Data
Pazpar2 is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Pazpar2 is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
@@
-330,16
+330,19
@@
struct record_cluster *reclist_read_record(struct reclist *l)
void reclist_enter(struct reclist *l)
{
yaz_mutex_enter(l->mutex);
void reclist_enter(struct reclist *l)
{
yaz_mutex_enter(l->mutex);
- if (l)
- l->sorted_ptr = l->sorted_list;
+ l->sorted_ptr = l->sorted_list;
}
void reclist_leave(struct reclist *l)
{
yaz_mutex_leave(l->mutex);
}
void reclist_leave(struct reclist *l)
{
yaz_mutex_leave(l->mutex);
- if (l)
- l->sorted_ptr = l->sorted_list;
+ l->sorted_ptr = l->sorted_list;
+}
+
+void reclist_rewind(struct reclist *l)
+{
+ l->sorted_ptr = l->sorted_list;
}
}
@@
-496,32
+499,28
@@
struct record_cluster *reclist_insert(struct reclist *l,
// We found a matching record. Merge them
if (!strcmp(merge_key, mkr->value))
{
// We found a matching record. Merge them
if (!strcmp(merge_key, mkr->value))
{
- struct record **re;
-
rb = *p;
rb = *p;
- for (re = &rb->record->records; *re; re = &(*re)->next)
+ if (!cluster)
{
{
- if ((*re)->client == record->client &&
- record_compare(record, *re, service))
+ struct record **re;
+ for (re = &rb->record->records; *re; re = &(*re)->next)
{
{
- yaz_mutex_leave(l->mutex);
- return 0;
+ if ((*re)->client == record->client &&
+ record_compare(record, *re, service))
+ {
+ yaz_mutex_leave(l->mutex);
+ return 0;
+ }
}
}
- }
-
- if (!cluster)
- {
cluster = rb->record;
*re = record;
record->next = 0;
cluster = rb->record;
*re = record;
record->next = 0;
- yaz_log(YLOG_LOG, "reclist: record insert %p", cluster);
}
else
{
if (cluster != rb->record)
{
assert(rb->record->relevance_explain1);
}
else
{
if (cluster != rb->record)
{
assert(rb->record->relevance_explain1);
- yaz_log(YLOG_LOG, "reclist: cluster merge %p %p", cluster, rb->record);
merge_cluster(l, r, cluster, rb->record);
(*total)--;
}
merge_cluster(l, r, cluster, rb->record);
(*total)--;
}
@@
-533,7
+532,6
@@
struct record_cluster *reclist_insert(struct reclist *l,
{
(*total)++;
cluster = new_cluster(l, r, service, record, merge_keys);
{
(*total)++;
cluster = new_cluster(l, r, service, record, merge_keys);
- yaz_log(YLOG_LOG, "reclist: new cluster p=%p", cluster);
}
if (!rb)
}
if (!rb)