return res;
}
-void reclist_limit(struct reclist *l, struct session *se)
+void reclist_limit(struct reclist *l, struct session *se, int lazy)
{
unsigned i;
int num = 0;
struct reclist_bucket **pp = &l->sorted_list;
reclist_enter(l);
- for (i = 0; i < l->hash_size; i++)
+
+ if (!lazy || !*pp)
{
- struct reclist_bucket *p;
- for (p = l->hashtable[i]; p; p = p->hash_next)
+ for (i = 0; i < l->hash_size; i++)
{
- if (session_check_cluster_limit(se, p->record))
+ struct reclist_bucket *p;
+ for (p = l->hashtable[i]; p; p = p->hash_next)
{
- *pp = p;
- pp = &p->sorted_next;
- num++;
+ if (session_check_cluster_limit(se, p->record))
+ {
+ *pp = p;
+ pp = &p->sorted_next;
+ num++;
+ }
}
}
+ *pp = 0;
}
- *pp = 0;
l->num_records = num;
reclist_leave(l);
}
struct reclist *reclist_create(NMEM);
void reclist_destroy(struct reclist *l);
-void reclist_limit(struct reclist *l, struct session *session);
+void reclist_limit(struct reclist *l, struct session *session, int lazy);
struct record_cluster *reclist_insert(struct reclist *tl,
struct conf_service *service,
struct record *record,
session_enter(se, "show_single_start");
*prev_r = 0;
*next_r = 0;
+ reclist_limit(se->reclist, se, 1);
reclist_enter(se->reclist);
while ((r = reclist_read_record(se->reclist)))
*sumhits = 0;
*approx_hits = 0;
*total = 0;
- reclist_limit(se->reclist, se);
+ reclist_limit(se->reclist, se, 0);
if (se->relevance)
{
for (spp = sp; spp; spp = spp->next)