summaryrefslogtreecommitdiff
path: root/commit.c
diff options
context:
space:
mode:
authorVasily Makarov <einmalfel@gmail.com>2014-01-03 14:45:46 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-01-03 18:29:03 (GMT)
commit6bc76725eaa2f4bb8c5fad47f843425d9160e7f3 (patch)
tree1c75d58677e9c63cb378819b78f0963ecc3b8acb /commit.c
parent44484662d83de2ae98d04738ec43d4dea1f859a8 (diff)
downloadgit-6bc76725eaa2f4bb8c5fad47f843425d9160e7f3.zip
git-6bc76725eaa2f4bb8c5fad47f843425d9160e7f3.tar.gz
git-6bc76725eaa2f4bb8c5fad47f843425d9160e7f3.tar.bz2
get_octopus_merge_bases(): cleanup redundant variable
pptr is needless. Some related code got cleaned as well. Signed-off-by: Vasily Makarov <einmalfel@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.c')
-rw-r--r--commit.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/commit.c b/commit.c
index 5df1df7..249a83b 100644
--- a/commit.c
+++ b/commit.c
@@ -841,26 +841,26 @@ static struct commit_list *merge_bases_many(struct commit *one, int n, struct co
struct commit_list *get_octopus_merge_bases(struct commit_list *in)
{
struct commit_list *i, *j, *k, *ret = NULL;
- struct commit_list **pptr = &ret;
- for (i = in; i; i = i->next) {
- if (!ret)
- pptr = &commit_list_insert(i->item, pptr)->next;
- else {
- struct commit_list *new = NULL, *end = NULL;
-
- for (j = ret; j; j = j->next) {
- struct commit_list *bases;
- bases = get_merge_bases(i->item, j->item, 1);
- if (!new)
- new = bases;
- else
- end->next = bases;
- for (k = bases; k; k = k->next)
- end = k;
- }
- ret = new;
+ if (!in)
+ return ret;
+
+ commit_list_insert(in->item, &ret);
+
+ for (i = in->next; i; i = i->next) {
+ struct commit_list *new = NULL, *end = NULL;
+
+ for (j = ret; j; j = j->next) {
+ struct commit_list *bases;
+ bases = get_merge_bases(i->item, j->item, 1);
+ if (!new)
+ new = bases;
+ else
+ end->next = bases;
+ for (k = bases; k; k = k->next)
+ end = k;
}
+ ret = new;
}
return ret;
}