git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/3] commit-graph: remove a duplicate assignment

From
Derrick Stolee <stolee@gmail.com>
Date
Sep 26, 2019, 13:02 UTC
Message-ID
<8307cccf-e115-c720-6670-2ab537066a01@gmail.com>
In-Reply-To
<20190925020158.751492-2-alexhenrie24@gmail.com>
On 9/24/2019 10:01 PM, Alex Henrie wrote:
Show 17 quoted lines
> Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
> ---
>  commit-graph.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/commit-graph.c b/commit-graph.c
> index 9b02d2c426..659f4bb4f4 100644
> --- a/commit-graph.c
> +++ b/commit-graph.c
> @@ -1534,7 +1534,6 @@ static void split_graph_merge_strategy(struct write_commit_graph_context *ctx)
>  		size_mult = ctx->split_opts->size_multiple;
>  	}
>  
> -	g = ctx->r->objects->commit_graph;
>  	ctx->num_commit_graphs_after = ctx->num_commit_graphs_before + 1;
>  
>  	while (g && (g->num_commits <= size_mult * num_commits ||

Could we instead remove the assignment during the declaration? It is easier to know the while loop will work if the assignment is closer to the loop.

Thanks,
-Stolee
 
Previous: Alex HenrieNext: Alex Henrie
Message 3 of 13 in “scan-build fixes”
  1. 0/3 scan-build fixesAlex Henrie, Sep 25, 2019
  2. 1/3 commit-graph: remove a duplicate assignmentAlex Henrie, Sep 25, 2019
  3. Derrick StoleeSep 26, 2019
  4. Alex HenrieSep 26, 2019
  5. 2/3 diffcore-break: use a goto instead of a redundant if statementAlex Henrie, Sep 25, 2019
  6. Derrick StoleeSep 26, 2019
  7. 3/3 wrapper: use a loop instead of repetitive statementsAlex Henrie, Sep 25, 2019
  8. Derrick StoleeSep 26, 2019
  9. Johannes SchindelinSep 26, 2019
  10. Jeff KingSep 27, 2019
  11. Alex HenrieSep 29, 2019
  12. Jeff KingSep 27, 2019
  13. Derrick StoleeSep 27, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.