[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nmh-workers] packf: change of cur

From: Peter Maydell
Subject: Re: [Nmh-workers] packf: change of cur
Date: Tue, 09 Nov 2010 21:41:47 +0000

markus schnalke wrote:
>I read through uip/packf.c and came across this:
>   177      if (mp->hghsel != mp->curmsg)
>   178          seq_setcur (mp, mp->lowsel);
>This sets the current message to the first message selected, unless
>the last message was the current. This special case is not documented
>in the man page.
>What's the reason for this special case? I'd rather remove it than
>update the documentation.

I don't know, but cvs annotate says it's been that way for over
a decade :-)   My guess is that it was an attempt to avoid the
overhead of setting the current message if it was already what
we wanted to set it to, but with an inadvertent error.
(Compare the code in uip/burst.c.)

However, if it's reasonable to avoid the overhead, we ought to do
it with a check in seq_setcur() where all callers can benefit from
it. So I think my choice would be to add a check to seq_setcur():
    if (mp->curmsg == msgnum)

and then remove this if () from packf.c, unless anybody can come
up with a justification for it that I'm not seeing.

-- PMM

reply via email to

[Prev in Thread] Current Thread [Next in Thread]