summaryrefslogtreecommitdiff
path: root/graph.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-02-15 20:54:19 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-02-15 20:54:19 (GMT)
commitcbf1860d73b782e7924e63361df485b31225a26a (patch)
treea86ce71a399fb8153be1552f08e51c58b2c5b5cf /graph.c
parent2f4e87d7777a0bcffa8a7cc3cc52e1e8b2c352ff (diff)
parent9e2edd66dda418dad751d5eb2e5921e05e57cd30 (diff)
downloadgit-cbf1860d73b782e7924e63361df485b31225a26a.zip
git-cbf1860d73b782e7924e63361df485b31225a26a.tar.gz
git-cbf1860d73b782e7924e63361df485b31225a26a.tar.bz2
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.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/graph.c b/graph.c
index 0649007..8b9049d 100644
--- a/graph.c
+++ b/graph.c
@@ -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