document: Remove duplicated code.

Since document_compare_by_tab_order_reverse does the exact reverse of
document_compare_by_tab_order the code need not to be duplicated. Instead
document_compare_by_tab_order can be called and the return value be reversed.
This commit is contained in:
Thomas Martitz 2013-11-02 14:20:20 +01:00 committed by Colomban Wendling
parent f403e7e8c2
commit 7fba0317d0

View File

@ -3670,20 +3670,7 @@ gint document_compare_by_tab_order(gconstpointer a, gconstpointer b)
*/
gint document_compare_by_tab_order_reverse(gconstpointer a, gconstpointer b)
{
GeanyDocument *doc_a = *((GeanyDocument**) a);
GeanyDocument *doc_b = *((GeanyDocument**) b);
gint notebook_position_doc_a;
gint notebook_position_doc_b;
notebook_position_doc_a = document_get_notebook_page(doc_a);
notebook_position_doc_b = document_get_notebook_page(doc_b);
if (notebook_position_doc_a < notebook_position_doc_b)
return 1;
if (notebook_position_doc_a > notebook_position_doc_b)
return -1;
/* equality */
return 0;
return -1 * document_compare_by_tab_order(a, b);
}