Index: article-thread.c
===================================================================
RCS file: /cvs/gnome/pan/pan/base/article-thread.c,v
retrieving revision 1.41
diff -u -r1.41 article-thread.c
--- article-thread.c	29 Jan 2003 22:42:46 -0000	1.41
+++ article-thread.c	12 Feb 2003 19:05:24 -0000
@@ -334,11 +334,11 @@
 	return strcmp (a->name, b->name);
 }
 
-static void
-sort_articles_impl (Article      ** buf,
-                    size_t          article_qty,
-                    int             sort_type,
-                    gboolean        ascending)
+void
+sort_articles (Article      ** buf,
+               size_t          article_qty,
+               int             sort_type,
+               gboolean        ascending)
 {
 	g_return_if_fail (articles_are_valid ((const Article **)buf, article_qty));
 
@@ -416,38 +416,6 @@
 			buf[article_qty-1-i] = tmp;
 		}
 	}
-}
-
-static int
-sort_articles_gslist_compare_func (gconstpointer a, gconstpointer b, gpointer user_data)
-{
-	GHashTable * article_to_index = (GHashTable*) user_data;
-	const int ai = GPOINTER_TO_INT(g_hash_table_lookup(article_to_index,a));
-	const int bi = GPOINTER_TO_INT(g_hash_table_lookup(article_to_index,b));
-	return ai - bi;
-}
-
-void
-sort_articles (Article      ** buf,
-               size_t          article_qty,
-               int             sort_type,
-               gboolean        ascending)
-{
-	int i;
-	GHashTable * article_to_index;
-
-	/* sort the big array */
-	sort_articles_impl (buf, article_qty, sort_type, ascending);
-
-	/* rethread the child GSLists with the same sort order.
-	 * since buf is already sorted, we can key off of the articles' indices there
-	 * rather than going through the work of actually sorting each subthread */
-	article_to_index = g_hash_table_new (g_direct_hash, g_direct_equal);
-	for (i=0; i<article_qty; ++i)
-		g_hash_table_insert (article_to_index, buf[i], GINT_TO_POINTER(i));
-	for (i=0; i<article_qty; ++i)
-		buf[i]->threads = g_slist_sort_with_data (buf[i]->threads, sort_articles_gslist_compare_func, article_to_index);
-	g_hash_table_destroy (article_to_index);
 }
 
 
