}
void whowassearch_exe(struct searchNode *search, searchCtx *ctx) {
- int matches = 0;
+ int i, matches = 0;
whowas *ww;
nick *sender = ctx->sender;
senderNSExtern = sender;
/* The top-level node needs to return a BOOL */
search=coerceNode(ctx, search, RETURNTYPE_BOOL);
- for (ww = whowas_head; ww; ww = ww->next) {
+ for (i = whowasoffset; i < whowasoffset + WW_MAXENTRIES; i++) {
+ ww = &whowasrecs[i % WW_MAXENTRIES];
+
+ if (ww->type == WHOWAS_UNUSED)
+ continue;
+
/* Note: We're passing the nick to the filter function. The original
* whowas record is in the nick's ->next field. */
- if ((search->exe)(ctx, search, ww->nick)) {
+ if ((search->exe)(ctx, search, &ww->nick)) {
if (matches<limit)
display(ctx, sender, ww);