diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-10-26 12:15:51 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-10-26 13:09:23 -0700 |
commit | 764161391f2dd3fc12a5bec1385e0ab40dd90fd6 (patch) | |
tree | 76a2fcca03e6df07832603195cac66ff6c499c65 /builtin/grep.c | |
parent | 1487a12ba228c6003f503366f40840eee9887179 (diff) | |
download | git-764161391f2dd3fc12a5bec1385e0ab40dd90fd6.tar.gz git-764161391f2dd3fc12a5bec1385e0ab40dd90fd6.tar.xz |
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>
Diffstat (limited to 'builtin/grep.c')
-rw-r--r-- | builtin/grep.c | 10 |
1 files 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; } |