mirror of
https://github.com/git/git
synced 2024-08-28 12:09:19 +00:00
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>
This commit is contained in:
parent
1487a12ba2
commit
764161391f
|
@ -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);
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue