Re: why is goto_num_tagged_header() so slow? analysis included...
Thomas Schultz <[email protected]>
| Newsgroups | gmane.network.slrn.user |
|---|---|
| Message-ID | <[email protected]> |
Hi! * jurriaan <[email protected]> [Wed 2005-10-05 09:00 PM] : > Why does slrn_goto_header go through all of them? Or at least, why > doesn't slrn_goto_num_tagged_header just set Slrn_Current_Header > directly? If it's in Num_Tag_List, it's an existing header and you can > just select it directly, [...] Actually, you are on the right track. All that was needed for a full analysis of your question was to check all occurences of slrn_goto_header. It turns out that in most cases, it is safe to assume that its argument is a valid header. In the one case where it was not (Mark_Header), it was easy to make the call secure by adding some lines of code to the function that expunges read articles. While I was at it, I made sure that Last_Read_Header does not get needlessly invalidated if it points to a header that is kept while expunging. After that, it was safe to remove the inefficient searching code in slrn_goto_header. To be on the safe side, I also added a warning note for future users. -- Thomas Schultz <[email protected]> News on slrn: http://slrn.sf.net/news.html .-----------------------------. [2004-10-07] Released slrn 0.9.8.1 | Home of the slrn newsreader | [2003-08-25] Released slrn 0.9.8.0 | http://slrn.sourceforge.net | [2003-08-19] New slrn FAQ available ------------------------------------------------------- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl