]> Kevux Git Server - rit/commitdiff
blame: micro-optimize cmp_suspect()
authorJunio C Hamano <junkio@cox.net>
Tue, 20 Mar 2007 05:17:10 +0000 (22:17 -0700)
committerJunio C Hamano <junkio@cox.net>
Tue, 20 Mar 2007 05:17:10 +0000 (22:17 -0700)
The commit structures are guaranteed their uniqueness by the object
layer, so we can check their address and see if they are the same
without going down to the object sha1 level.

Signed-off-by: Junio C Hamano <junkio@cox.net>
builtin-blame.c

index b51cdc7..104521e 100644 (file)
@@ -182,9 +182,8 @@ struct scoreboard {
 
 static int cmp_suspect(struct origin *a, struct origin *b)
 {
-       int cmp = hashcmp(a->commit->object.sha1, b->commit->object.sha1);
-       if (cmp)
-               return cmp;
+       if (a->commit != b->commit)
+               return 1;
        return strcmp(a->path, b->path);
 }