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 <gitster@pobox.com>

Junio C Hamano committed Oct 26, 2011 at 12:15 UTC 764161391f2dd3fc12a5bec1385e0ab40dd90fd6
1 file changed +3 -7
builtin/grep.c
+3 -7
@@ -373,13 +373,9 @@ static void *lock_and_read_sha1_file(const unsigned char *sha1, enum object_type
373 {
374 void *data;
375
376 - if (use_threads) {
377 - read_sha1_lock();
378 - data = read_sha1_file(sha1, type, size);
379 - read_sha1_unlock();
380 - } else {
381 - data = read_sha1_file(sha1, type, size);
382 - }
376 + read_sha1_lock();
377 + data = read_sha1_file(sha1, type, size);
378 + read_sha1_unlock();
379 return data;
380 }
381