From 431d1b624180925a9be02590d4c5af845b8e2fce Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 25 Jan 2003 16:44:07 +0000 Subject: [PATCH] (object_compare): Compare inode numbers before device numbers. The former is much more likely to differ for any two given file objects. --- lib/ftw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ftw.c b/lib/ftw.c index ef1e2a9..2386910 100644 --- a/lib/ftw.c +++ b/lib/ftw.c @@ -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); } -- 2.7.4