Skip to content

Commit

Permalink
Convert an if-else block to a simple one-line
Browse files Browse the repository at this point in the history
  • Loading branch information
konsolebox committed Aug 1, 2016
1 parent a6b84e2 commit aaeab39
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/notebook.c
Original file line number Diff line number Diff line change
Expand Up @@ -855,10 +855,8 @@ void notebook_sort_tabs(NotebookTabSortMethod method)
foreach_document(i)
g_ptr_array_add(docs, documents[i]);

if (method == NOTEBOOK_TAB_SORT_BY_FILENAME)
g_ptr_array_sort(docs, compare_docs_by_filename);
else
g_ptr_array_sort(docs, compare_docs_by_pathname);
g_ptr_array_sort(docs, method == NOTEBOOK_TAB_SORT_BY_FILENAME ?
compare_docs_by_filename : compare_docs_by_pathname);

for (i = 0; i < docs->len; ++i)
{
Expand Down

0 comments on commit aaeab39

Please sign in to comment.