From: Junio C Hamano Date: Tue, 20 Mar 2007 05:17:10 +0000 (-0700) Subject: blame: micro-optimize cmp_suspect() X-Git-Tag: v1.5.1-rc2~57 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/57584d9eddc3482c5db0308203b9df50dc62109c 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 --- diff --git a/builtin-blame.c b/builtin-blame.c index b51cdc71fa..104521e673 100644 --- a/builtin-blame.c +++ b/builtin-blame.c @@ -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); }