mirror of
https://gitlab.gnome.org/GNOME/nautilus
synced 2024-11-04 19:08:23 +00:00
directory-async: Simplify function
Simplify ordered comparision function into equality since it's not being used as ordered comparsion. Keep the name to imply that it still treats 0 as an equal, same as GCompareFunc.
This commit is contained in:
parent
da6e80fee6
commit
e3052ab1c8
1 changed files with 5 additions and 39 deletions
|
@ -1212,45 +1212,11 @@ ready_callback_key_compare (gconstpointer a,
|
|||
callback_a = a;
|
||||
callback_b = b;
|
||||
|
||||
if (callback_a->file < callback_b->file)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
if (callback_a->file > callback_b->file)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
if (callback_a->file == NULL)
|
||||
{
|
||||
if (callback_a->callback.directory < callback_b->callback.directory)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
if (callback_a->callback.directory > callback_b->callback.directory)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (callback_a->callback.file < callback_b->callback.file)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
if (callback_a->callback.file > callback_b->callback.file)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
if (callback_a->callback_data < callback_b->callback_data)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
if (callback_a->callback_data > callback_b->callback_data)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
return !(callback_a->file == callback_b->file &&
|
||||
(callback_a->file != NULL ?
|
||||
callback_a->callback.file == callback_b->callback.file :
|
||||
callback_a->callback.directory == callback_b->callback.directory) &&
|
||||
callback_a->callback_data == callback_b->callback_data);
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
Loading…
Reference in a new issue