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
Add reclist rewind function
[pazpar2-moved-to-github.git]
/
src
/
reclists.c
diff --git
a/src/reclists.c
b/src/reclists.c
index
f07a2cb
..
103eefd
100644
(file)
--- a/
src/reclists.c
+++ b/
src/reclists.c
@@
-342,6
+342,12
@@
void reclist_leave(struct reclist *l)
l->sorted_ptr = l->sorted_list;
}
l->sorted_ptr = l->sorted_list;
}
+void reclist_rewind(struct reclist *l)
+{
+ if (l)
+ l->sorted_ptr = l->sorted_list;
+}
+
struct reclist *reclist_create(NMEM nmem)
{
struct reclist *reclist_create(NMEM nmem)
{
@@
-496,21
+502,19
@@
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;