From 9b09a5ff483aef05dc5b4d9ab0fd0243d21cb1d3 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Sat, 12 Jun 2021 19:20:47 -0400 Subject: Use SEARCH for a subset of thread roots This does way less duplicate work by fetching all threads and all thread root envelopes once, then doing searches for subsets of thread roots. --- html.c | 75 +++++++++++++++++++++++++++++++++++------------------------------- 1 file changed, 40 insertions(+), 35 deletions(-) (limited to 'html.c') diff --git a/html.c b/html.c index 6b25996..1dc531c 100644 --- a/html.c +++ b/html.c @@ -512,17 +512,17 @@ int htmlThreadClose(FILE *file) { || htmlFooter(file); } -static char *htmlSearchURL(const char *name, const char *type) { +static char *htmlIndexURL(const char *name, const char *type) { struct Variable vars[] = { { "name", name }, { "type", type }, {0}, }; - return templateString(PATH_SEARCH, vars, escapeURL); + return templateString(PATH_INDEX, vars, escapeURL); } -int htmlSearchHead(FILE *file, const char *name) { - char *atom = htmlSearchURL(name, "atom"); +int htmlIndexHead(FILE *file, const char *name) { + char *atom = htmlIndexURL(name, "atom"); const char *template = Q( @@ -545,40 +545,47 @@ int htmlSearchHead(FILE *file, const char *name) { return error; } -static int htmlSearchNav( - FILE *file, const char *name, char *searches[const], size_t len -) { - if (len < 2 || strcmp(name, "index")) return 0; - int error = templateRender(file, Q(