1
0
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:
Jim Meyering
2003-01-25 16:44:07 +00:00
parent 29faf21e94
commit 431d1b6241
+2 -2
View File
@@ -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);
}