]> granicus.if.org Git - mutt/commit
Display matching new messages in a thread-limited index.
authorKevin McCarthy <kevin@8t8.us>
Fri, 20 Jul 2018 03:28:38 +0000 (20:28 -0700)
committerKevin McCarthy <kevin@8t8.us>
Fri, 20 Jul 2018 20:38:27 +0000 (13:38 -0700)
commit1d41321aef89979d5c40b6772c0752ab6f3fd21a
treecb2dce6470f88454808966e99e4c49c34ee17b7c
parentf0772c95d7be2be44195c04f248e9c9211889d3f
Display matching new messages in a thread-limited index.

Previously, the index performed pattern matching first, and then
resorted new mail.  The problem was that thread-limiting patterns,
e.g. ~(pattern), require threading data to properly match against the
new messages.

We already save new messages for the purposes of uncollapsing threads.
To keep the code cleaner, split off update_index() into
update_index_threaded()/unthreaded().  Then for threaded mode, save
the new messages first.  We can then sort (before pattern matching),
and use the save_new array to pattern match the new messages
afterwards.

The $uncollapse_new loop was unnecessarily performing a n^2 search.
Simplify to just iteratate over the save_new instead.
curs_main.c