Skip to content

Commit

Permalink
builtin/grep: simplify lock_and_read_sha1_file()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Oct 26, 2011
1 parent 1487a12 commit 7641613
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions builtin/grep.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 7641613

Please sign in to comment.