shortlog: optimize out useless "<none>" normalization
commited7eba902202be030aae28aba29fe7b294cbee5d
authorJeff King <peff@peff.net>
Mon, 18 Jan 2016 20:02:56 +0000 (18 15:02 -0500)
committerJunio C Hamano <gitster@pobox.com>
Tue, 19 Jan 2016 17:55:03 +0000 (19 09:55 -0800)
tree21f5d203d78a6ba514a995257a50f60cade7d8c6
parent4e1d1a2eea25878a2128e376bff8b4a1b2216b15
shortlog: optimize out useless "<none>" normalization

If we are in --summary mode, we will always pass <none> to
insert_one_record, which will then do some normalization
(e.g., cutting out "[PATCH]"). There's no point in doing so
if we aren't going to use the result anyway.

This drops my best-of-five for "git shortlog -ns HEAD" on
linux.git from:

  real    0m5.257s
  user    0m5.104s
  sys     0m0.156s

to:

  real    0m5.194s
  user    0m5.028s
  sys     0m0.168s

That's only 1%, but arguably the result is clearer to read,
as we're able to group our variable declarations inside the
conditional block. It also opens up further optimization
possibilities for future patches.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/shortlog.c