From eaa867703927c1f383637979d16c40d996cea240 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Wed, 30 May 2007 02:12:28 -0400 Subject: Simplify index access condition in count-objects, pack-redundant My earlier lazy index opening patch changed this condition to check index_data and call open_pack_index if it was NULL. In truth we only care about num_objects. Since open_pack_index does no harm if the index is already open, and all indexes are likely to be closed in this application, the "performance optimization" of inlining the index_data check here was wrong. Signed-off-by: Shawn O. Pearce Signed-off-by: Junio C Hamano --- pack-redundant.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pack-redundant.c') diff --git a/pack-redundant.c b/pack-redundant.c index 06173206f..6bc3bdf3f 100644 --- a/pack-redundant.c +++ b/pack-redundant.c @@ -550,7 +550,7 @@ static struct pack_list * add_pack(struct packed_git *p) l.pack = p; llist_init(&l.all_objects); - if (!p->index_data && open_pack_index(p)) + if (open_pack_index(p)) return NULL; base = p->index_data; -- cgit v1.2.1