From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/45735 Path: main.gmane.org!not-for-mail From: Jason Merrill Newsgroups: gmane.emacs.gnus.general Subject: Small speedup PATCH to gnus-summary-insert-new-articles Date: Fri, 19 Jul 2002 14:39:28 +0100 Sender: owner-ding@hpc.uh.edu Message-ID: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1027086160 6930 127.0.0.1 (19 Jul 2002 13:42:40 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 19 Jul 2002 13:42:40 +0000 (UTC) Cc: Jason Merrill Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 17VY1m-0001nd-00 for ; Fri, 19 Jul 2002 15:42:38 +0200 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 17VY0z-00047q-00; Fri, 19 Jul 2002 08:41:49 -0500 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Fri, 19 Jul 2002 08:42:13 -0500 (CDT) Original-Received: from sclp3.sclp.com (qmailr@sclp3.sclp.com [209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id IAA13454 for ; Fri, 19 Jul 2002 08:42:03 -0500 (CDT) Original-Received: (qmail 27776 invoked by alias); 19 Jul 2002 13:41:34 -0000 Original-Received: (qmail 27771 invoked from network); 19 Jul 2002 13:41:34 -0000 Original-Received: from dell-paw-3.cambridge.redhat.com (HELO executor.cambridge.redhat.com) (195.224.55.237) by gnus.org with SMTP; 19 Jul 2002 13:41:34 -0000 Original-Received: from prospero.cambridge.redhat.com (dell-paw-2.cambridge.redhat.com [195.224.55.226]) by executor.cambridge.redhat.com (Postfix) with ESMTP id 55206ABB13; Fri, 19 Jul 2002 14:41:19 +0100 (BST) Original-Received: by prospero.cambridge.redhat.com (Postfix, from userid 4046) id C57E1F83C1; Fri, 19 Jul 2002 14:39:28 +0100 (BST) Original-To: ding@gnus.org Original-Lines: 41 User-Agent: Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.1 (i686-pc-linux-gnu) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:45735 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:45735 --=-=-= In an earlier patch (2001-04-12) I added the nreverse below so that the articles would be listed in the right order. Shortly after sending that patch, I realized that we might as well just build up the list in the right order. 2001-11-04 Jason Merrill * gnus-sum.el (gnus-summary-insert-new-articles): Count down to avoid nreverse. --=-=-= Content-Type: text/x-patch Content-Disposition: inline *** gnus-sum.el.~1~ Fri Jul 19 13:07:23 2002 --- gnus-sum.el Fri Jul 19 13:05:41 2002 *************** If ALL is a number, fetch this number of *** 11092,11104 **** i new) (setq gnus-newsgroup-active (gnus-activate-group gnus-newsgroup-name 'scan)) ! (setq i (1+ (cdr old-active))) ! (while (<= i (cdr gnus-newsgroup-active)) (push i new) ! (incf i)) (if (not new) (message "No gnus is bad news.") - (setq new (nreverse new)) (gnus-summary-insert-articles new) (setq gnus-newsgroup-unreads (gnus-sorted-nunion gnus-newsgroup-unreads new)) --- 11092,11103 ---- i new) (setq gnus-newsgroup-active (gnus-activate-group gnus-newsgroup-name 'scan)) ! (setq i (cdr gnus-newsgroup-active)) ! (while (> i (cdr old-active)) (push i new) ! (decf i)) (if (not new) (message "No gnus is bad news.") (gnus-summary-insert-articles new) (setq gnus-newsgroup-unreads (gnus-sorted-nunion gnus-newsgroup-unreads new)) --=-=-=--