From: Art Cancro Date: Fri, 3 Jun 2011 21:53:18 +0000 (-0400) Subject: Stop processing if the viewer is only interested in a single post and that message... X-Git-Tag: v8.11~672 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=ece7533e4775cac35ec317f748b2f0b2ef94c626 Stop processing if the viewer is only interested in a single post and that message ID is neither the id nor the refs. --- diff --git a/webcit/blogview_renderer.c b/webcit/blogview_renderer.c index ad287361e..6492f20ad 100644 --- a/webcit/blogview_renderer.c +++ b/webcit/blogview_renderer.c @@ -176,14 +176,21 @@ int blogview_LoadMsgFromServer(SharedMessageStatus *Stat, HashList *BLOG = (HashList *) *ViewSpecific; struct bltr b; struct blogpost *bp = NULL; + int p = 0; b = blogview_learn_thread_references(Msg->msgnum); - /* FIXME an optimization here -- one we ought to perform -- is to exit this - * function immediately if the viewer is only interested in a single post and + /* Stop processing if the viewer is only interested in a single post and * that message ID is neither the id nor the refs. */ + p = atoi(BSTR("p")); /* are we looking for a specific post? */ + if ((p != 0) && (p != b.id) && (p != b.refs)) { + return 200; + } + /* + * Add our little bundle of blogworthy wonderfulness to the hash table + */ if (b.refs == 0) { bp = malloc(sizeof(struct blogpost)); if (!bp) return(200);