Skip to content

Commit 01a56f6

Browse files
committed
Merge pull request soulmachine#11 from advancedxy/master
change variable name h to dummy to follow name convention
2 parents c4f6258 + c6a7e96 commit 01a56f6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

C++/chapSorting.tex

+3-3
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,14 @@ \subsubsection{代码}
6262
ListNode *mergeTwoLists(ListNode *l1, ListNode *l2) {
6363
if (l1 == nullptr) return l2;
6464
if (l2 == nullptr) return l1;
65-
ListNode h(-1);
66-
ListNode *p = &h;
65+
ListNode dummy(-1);
66+
ListNode *p = &dummy;
6767
for (; l1 != nullptr && l2 != nullptr; p = p->next) {
6868
if (l1->val > l2->val) { p->next = l2; l2 = l2->next; }
6969
else { p->next = l1; l1 = l1->next; }
7070
}
7171
p->next = l1 != nullptr ? l1 : l2;
72-
return h.next;
72+
return dummy.next;
7373
}
7474
};
7575
\end{Code}

0 commit comments

Comments
 (0)