From 57584d9eddc3482c5db0308203b9df50dc62109c Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 19 Mar 2007 22:17:10 -0700 Subject: [PATCH] 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 --- builtin-blame.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/builtin-blame.c b/builtin-blame.c index b51cdc71f..104521e67 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); } -- 2.26.2