blame: micro-optimize cmp_suspect()

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>
maint
Junio C Hamano 2007-03-19 22:17:10 -07:00
parent 567fb65e25
commit 57584d9edd
1 changed files with 2 additions and 3 deletions

View File

@ -182,9 +182,8 @@ struct scoreboard {


static int cmp_suspect(struct origin *a, struct origin *b) static int cmp_suspect(struct origin *a, struct origin *b)
{ {
int cmp = hashcmp(a->commit->object.sha1, b->commit->object.sha1); if (a->commit != b->commit)
if (cmp) return 1;
return cmp;
return strcmp(a->path, b->path); return strcmp(a->path, b->path);
} }