mirror of
git://git.sv.gnu.org/coreutils.git
synced 2026-08-17 09:06:50 +02:00
(object_compare): Compare inode numbers before device numbers.
The former is much more likely to differ for any two given file objects.
This commit is contained in:
@@ -213,10 +213,10 @@ object_compare (const void *p1, const void *p2)
|
||||
accidentally compare `holes' in the structure. */
|
||||
const struct known_object *kp1 = p1, *kp2 = p2;
|
||||
int cmp1;
|
||||
cmp1 = (kp1->dev > kp2->dev) - (kp1->dev < kp2->dev);
|
||||
cmp1 = (kp1->ino > kp2->ino) - (kp1->ino < kp2->ino);
|
||||
if (cmp1 != 0)
|
||||
return cmp1;
|
||||
return (kp1->ino > kp2->ino) - (kp1->ino < kp2->ino);
|
||||
return (kp1->dev > kp2->dev) - (kp1->dev < kp2->dev);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user