{"thread":{"id":"37605","subject":"[PATCH 1/2] graph: simplify graph_padding_line()","startedAt":"2014-09-20T18:29:53Z","lastAt":"2014-09-20T21:35:58Z","messageCount":2,"participants":["René Scharfe"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"249701","messageId":"541DC7A1.1000509@web.de","threadId":"37605","inReplyTo":null,"subject":"[PATCH 1/2] graph: simplify graph_padding_line()","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2014-09-20T18:29:53Z","receivedAt":"2014-09-20T18:29:53Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Deduplicate code common to both branches of if statements.\n\nSigned-off-by: Rene Scharfe <l.s.r@web.de>\n---\n graph.c | 17 ++++-------------\n 1 file changed, 4 insertions(+), 13 deletions(-)\n\ndiff --git a/graph.c b/graph.c\nindex dfb99f6..52605e4 100644\n--- a/graph.c\n+++ b/graph.c\n@@ -1161,20 +1161,11 @@ static void graph_padding_line(struct git_graph *graph, struct strbuf *sb)\n \t */\n \tfor (i = 0; i < graph->num_columns; i++) {\n \t\tstruct column *col = &graph->columns[i];\n-\t\tstruct commit *col_commit = col->commit;\n-\t\tif (col_commit == graph->commit) {\n-\t\t\tstrbuf_write_column(sb, col, '|');\n-\n-\t\t\tif (graph->num_parents < 3)\n-\t\t\t\tstrbuf_addch(sb, ' ');\n-\t\t\telse {\n-\t\t\t\tint num_spaces = ((graph->num_parents - 2) * 2);\n-\t\t\t\tstrbuf_addchars(sb, ' ', num_spaces);\n-\t\t\t}\n-\t\t} else {\n-\t\t\tstrbuf_write_column(sb, col, '|');\n+\t\tstrbuf_write_column(sb, col, '|');\n+\t\tif (col->commit == graph->commit && graph->num_parents > 2)\n+\t\t\tstrbuf_addchars(sb, ' ', (graph->num_parents - 2) * 2);\n+\t\telse\n \t\t\tstrbuf_addch(sb, ' ');\n-\t\t}\n \t}\n \n \tgraph_pad_horizontally(graph, sb, graph->num_columns);\n-- \n2.1.1\n"},{"id":"249703","messageId":"541DF33E.6080400@web.de","threadId":"37605","inReplyTo":"541DC7A1.1000509@web.de","subject":"Re: [PATCH 1/2] graph: simplify graph_padding_line()","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2014-09-20T21:35:58Z","receivedAt":"2014-09-20T21:35:58Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Am 20.09.2014 um 20:29 schrieb René Scharfe:\n> Deduplicate code common to both branches of if statements.\n\nThere is no 2/2, this patch is the only one at this time.\n\nRené\n"}]}