]> code.citadel.org Git - citadel.git/commitdiff
* CtdlForEachMessage() -- avoid scanning v_seen sequence set for each message
authorArt Cancro <ajc@citadel.org>
Mon, 8 Aug 2005 14:28:41 +0000 (14:28 +0000)
committerArt Cancro <ajc@citadel.org>
Mon, 8 Aug 2005 14:28:41 +0000 (14:28 +0000)
  during a MSGS_ALL fetch, because the results don't matter.

citadel/ChangeLog
citadel/msgbase.c

index fb8919d9a1ebb69b3708978aa27bafb6dca2e682..be0b5c10891141e3790114e8833439afa076ab11 100644 (file)
@@ -1,4 +1,8 @@
 $Log$
+Revision 654.2  2005/08/08 14:28:41  ajc
+* CtdlForEachMessage() -- avoid scanning v_seen sequence set for each message
+  during a MSGS_ALL fetch, because the results don't matter.
+
 Revision 654.1  2005/08/05 21:31:01  ajc
 * Any "delete message" operation which is synchronous to a client is now
   deferred.  This is accomplished by copying the message pointer to
@@ -6994,3 +6998,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import
+
index e70269533c6a578374d681cab2320ba931628616..10b2c0fdc25d484d3e3f44569220ab0fbb099056 100644 (file)
@@ -499,7 +499,7 @@ int CtdlForEachMessage(int mode, long ref,
        long thismsg;
        struct MetaData smi;
        struct CtdlMessage *msg;
-       int is_seen;
+       int is_seen = 0;
        long lastold = 0L;
        int printed_lastold = 0;
 
@@ -574,8 +574,14 @@ int CtdlForEachMessage(int mode, long ref,
        if (num_msgs > 0)
                for (a = 0; a < num_msgs; ++a) {
                        thismsg = msglist[a];
-                       is_seen = is_msg_in_sequence_set(vbuf.v_seen, thismsg);
-                       if (is_seen) lastold = thismsg;
+                       if (mode == MSGS_ALL) {
+                               is_seen = 0;
+                       }
+                       else {
+                               is_seen = is_msg_in_sequence_set(
+                                                       vbuf.v_seen, thismsg);
+                               if (is_seen) lastold = thismsg;
+                       }
                        if ((thismsg > 0L)
                            && (