Re: [PATCH] fast-import: use hashcmp() for SHA1 hash comparison
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Jul 18, 2014, 18:42 UTC
- Message-ID
- <20140718184246.GS12427@google.com>
- In-Reply-To
- <53C944B3.5080106@web.de>
René Scharfe wrote:
> Signed-off-by: Rene Scharfe <l.s.r@web.de> > --- > fast-import.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-)
Before:
$ size git-fast-import
text data bss dec hex filename
804138 6768 754160 1565066 17e18a git-fast-importAfter:
$ size git-fast-import
text data bss dec hex filename
804154 6768 754160 1565082 17e19a git-fast-importSo this makes the text size worse on this machine (amd64, building with gcc 4.8.2 -O2). That's probably because the old code does 'call memcmp', while the new code inlines it. Inlining is presumably the better choice.
More importantly, the new code is more readable.
For what it's worth, Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>