diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-02-15 12:54:19 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-02-15 12:54:19 -0800 |
commit | cbf1860d73b782e7924e63361df485b31225a26a (patch) | |
tree | a86ce71a399fb8153be1552f08e51c58b2c5b5cf /graph.c | |
parent | 2f4e87d7777a0bcffa8a7cc3cc52e1e8b2c352ff (diff) | |
parent | 9e2edd66dda418dad751d5eb2e5921e05e57cd30 (diff) | |
download | git-cbf1860d73b782e7924e63361df485b31225a26a.tar.gz |
Merge branch 'rs/swap'
Code clean-up.
* rs/swap:
graph: use SWAP macro
diff: use SWAP macro
use SWAP macro
apply: use SWAP macro
add SWAP macro
Diffstat (limited to 'graph.c')
-rw-r--r-- | graph.c | 11 |
1 files changed, 2 insertions, 9 deletions
@@ -497,7 +497,6 @@ static void graph_update_width(struct git_graph *graph, static void graph_update_columns(struct git_graph *graph) { struct commit_list *parent; - struct column *tmp_columns; int max_new_columns; int mapping_idx; int i, seen_this, is_commit_in_columns; @@ -510,11 +509,8 @@ static void graph_update_columns(struct git_graph *graph) * We'll re-use the old columns array as storage to compute the new * columns list for the commit after this one. */ - tmp_columns = graph->columns; - graph->columns = graph->new_columns; + SWAP(graph->columns, graph->new_columns); graph->num_columns = graph->num_new_columns; - - graph->new_columns = tmp_columns; graph->num_new_columns = 0; /* @@ -1031,7 +1027,6 @@ static void graph_output_post_merge_line(struct git_graph *graph, struct strbuf static void graph_output_collapsing_line(struct git_graph *graph, struct strbuf *sb) { int i; - int *tmp_mapping; short used_horizontal = 0; int horizontal_edge = -1; int horizontal_edge_target = -1; @@ -1166,9 +1161,7 @@ static void graph_output_collapsing_line(struct git_graph *graph, struct strbuf /* * Swap mapping and new_mapping */ - tmp_mapping = graph->mapping; - graph->mapping = graph->new_mapping; - graph->new_mapping = tmp_mapping; + SWAP(graph->mapping, graph->new_mapping); /* * If graph->mapping indicates that all of the branch lines |