diff mbox series

[3/7] index-pack: unify threaded and unthreaded code

Message ID 2e7baaabf0ad9d724f5a81495213f4626b8c04ab.1598296530.git.jonathantanmy@google.com (mailing list archive)
State Superseded
Headers show
Series Better threaded delta resolution in index-pack (another try) | expand

Commit Message

Jonathan Tan Aug. 24, 2020, 7:16 p.m. UTC
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
---
 builtin/index-pack.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

Comments

Junio C Hamano Aug. 24, 2020, 9:11 p.m. UTC | #1
Jonathan Tan <jonathantanmy@google.com> writes:

> Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
> ---
>  builtin/index-pack.c | 10 +---------
>  1 file changed, 1 insertion(+), 9 deletions(-)
>
> diff --git a/builtin/index-pack.c b/builtin/index-pack.c
> index a8444d550b..357e03b5aa 100644
> --- a/builtin/index-pack.c
> +++ b/builtin/index-pack.c
> @@ -1211,15 +1211,7 @@ static void resolve_deltas(void)
>  		cleanup_thread();
>  		return;
>  	}
> -
> -	for (i = 0; i < nr_objects; i++) {
> -		struct object_entry *obj = &objects[i];
> -
> -		if (is_delta_type(obj->type))
> -			continue;
> -		resolve_base(obj);
> -		display_progress(progress, nr_resolved_deltas);
> -	}
> +	threaded_second_pass(&nothread_data);
>  }

The threaded_second_pass() function has a lot more noise than the
above simple and easy-to-grok loop, managing the locks, but those
all turn into no-op unless init_thread() is called, which happens
only when this code is not reached.  So OK, this looks essentially
a no-op clean-up.

Thanks.
diff mbox series

Patch

diff --git a/builtin/index-pack.c b/builtin/index-pack.c
index a8444d550b..357e03b5aa 100644
--- a/builtin/index-pack.c
+++ b/builtin/index-pack.c
@@ -1211,15 +1211,7 @@  static void resolve_deltas(void)
 		cleanup_thread();
 		return;
 	}
-
-	for (i = 0; i < nr_objects; i++) {
-		struct object_entry *obj = &objects[i];
-
-		if (is_delta_type(obj->type))
-			continue;
-		resolve_base(obj);
-		display_progress(progress, nr_resolved_deltas);
-	}
+	threaded_second_pass(&nothread_data);
 }
 
 /*