From f449198e58630b8b57c94e3eeab4927afd7ee03a Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Fri, 24 Jun 2016 23:09:21 +0000 Subject: coccinelle: convert hashcpy() with null_sha1 to hashclr() hashcpy with null_sha1 as the source is equivalent to hashclr. In addition to being simpler, using hashclr may give the compiler a chance to optimize better. Convert instances of hashcpy with the source argument of null_sha1 to hashclr. This transformation was implemented using the following semantic patch: @@ expression E1; @@ -hashcpy(E1, null_sha1); +hashclr(E1); Signed-off-by: brian m. carlson Signed-off-by: Junio C Hamano --- submodule-config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'submodule-config.c') diff --git a/submodule-config.c b/submodule-config.c index debab294d..a6c2710f9 100644 --- a/submodule-config.c +++ b/submodule-config.c @@ -368,7 +368,7 @@ static int gitmodule_sha1_from_commit(const unsigned char *commit_sha1, int ret = 0; if (is_null_sha1(commit_sha1)) { - hashcpy(gitmodules_sha1, null_sha1); + hashclr(gitmodules_sha1); return 1; } -- cgit v1.2.1