Thread View: news.software.readers
1 messages
1 total messages
Started by Thomas Schultz
Sun, 09 Jan 2000 00:00
[slrn] Bug: sorting methods 4 and 6 are broken
Author: Thomas Schultz
Date: Sun, 09 Jan 2000 00:00
Date: Sun, 09 Jan 2000 00:00
73 lines
2722 bytes
2722 bytes
Hi,
I am surprised that this has not been noticed earlier, but when
playing with different sorting methods, I noticed that methods 4 and 6
("sort by score" and "sort by score, then subject") produce wrong
results (at least with 0.9.6.2, I did not check when this bug was
introduced).
This is due to the fact that header_score_cmp() in art.c compares the
"thread_score" members of the articles. However, these are only set
properly when sort_threads() is called, not in non-threaded mode. This
can be fixed by adding an appropriate line in sort_by_server_number().
When looking at the code, I also noticed that (unless I'm mistaken)
slrn will do unneccessary work when sorting "by score, then subject".
I also changed this to what I think is a faster alternative. Here is
the patch:
#v+
diff -cr slrn-0.9.6.2.orig/src/art.c slrn-0.9.6.2/src/art.c
*** slrn-0.9.6.2.orig/src/art.c Mon Jan 3 14:40:41 2000
--- slrn-0.9.6.2/src/art.c Sun Jan 9 17:26:33 2000
***************
*** 3879,3884 ****
--- 3879,3887 ----
h->num_children = 0;
h->flags &= ~(HEADER_HIDDEN | ALL_THREAD_FLAGS);
h->sister = h->parent = h->child = NULL;
+ #if SLRN_HAS_SORT_BY_SCORE
+ h->thread_score = h->score;
+ #endif
h = next;
}
***************
*** 3929,3943 ****
else
sort_by_threads ();
if (Slrn_Sorting_Mode & SORT_BY_DATE)
sort_by_date ();
else if (Slrn_Sorting_Mode & SORT_BY_SUBJECT)
sort_by_subject ();
-
- #if SLRN_HAS_SORT_BY_SCORE
- if (Slrn_Sorting_Mode & SORT_BY_SCORE)
- sort_by_score ();
- #endif
}
/*}}}*/
--- 3932,3946 ----
else
sort_by_threads ();
+ #if SLRN_HAS_SORT_BY_SCORE
+ if (Slrn_Sorting_Mode & SORT_BY_SCORE)
+ sort_by_score ();
+ else
+ #endif
if (Slrn_Sorting_Mode & SORT_BY_DATE)
sort_by_date ();
else if (Slrn_Sorting_Mode & SORT_BY_SUBJECT)
sort_by_subject ();
}
/*}}}*/
#v-
--
Thomas Schultz <tststs@gmx.de>
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads