Skip to content

Commit 7641613

Browse files
committed
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 <[email protected]>
1 parent 1487a12 commit 7641613

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

builtin/grep.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -373,13 +373,9 @@ static void *lock_and_read_sha1_file(const unsigned char *sha1, enum object_type
373373
{
374374
void *data;
375375

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();
383379
return data;
384380
}
385381

0 commit comments

Comments
 (0)