From: Junio C Hamano Date: Wed, 26 Oct 2011 19:15:51 +0000 (-0700) Subject: builtin/grep: simplify lock_and_read_sha1_file() X-Git-Tag: v1.7.8-rc0~5^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=764161391f2dd3fc12a5bec1385e0ab40dd90fd6;p=git.git builtin/grep: simplify lock_and_read_sha1_file() As read_sha1_lock/unlock have been made aware of use_threads, this caller can be made a lot simpler. Signed-off-by: Junio C Hamano --- diff --git a/builtin/grep.c b/builtin/grep.c index 3ddfae4e7..3d7329d78 100644 --- a/builtin/grep.c +++ b/builtin/grep.c @@ -373,13 +373,9 @@ static void *lock_and_read_sha1_file(const unsigned char *sha1, enum object_type { void *data; - if (use_threads) { - read_sha1_lock(); - data = read_sha1_file(sha1, type, size); - read_sha1_unlock(); - } else { - data = read_sha1_file(sha1, type, size); - } + read_sha1_lock(); + data = read_sha1_file(sha1, type, size); + read_sha1_unlock(); return data; }