From 764161391f2dd3fc12a5bec1385e0ab40dd90fd6 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 26 Oct 2011 12:15:51 -0700 Subject: [PATCH] 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 --- builtin/grep.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) 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; } -- 2.30.2