8000 Merge pull request #11 from advancedxy/master · dotcom900825/leetcode@01a56f6 · GitHub
[go: up one dir, main page]

Skip to content
< 8000 script type="application/json" data-target="react-app.embeddedData">{"payload":{"commit":{"oid":"01a56f61ead5004b61b3686df5d50b82098d6bcf","url":"/dotcom900825/leetcode/commit/01a56f61ead5004b61b3686df5d50b82098d6bcf","authoredDate":"2014-01-06T21:39:40.000-08:00","committedDate":"2014-01-06T21:39:40.000-08:00","shortMessage":null,"shortMessageMarkdown":"\u003cdiv\u003eMerge pull request \u003ca class=\"issue-link js-issue-link\" data-error-text=\"Failed to load title\" data-id=\"25069019\" data-permission-text=\"Title is private\" data-url=\"https://github.com/soulmachine/leetcode/issues/11\" data-hovercard-type=\"pull_request\" data-hovercard-url=\"/soulmachine/leetcode/pull/11/hovercard\" href=\"https://github.com/soulmachine/leetcode/pull/11\"\u003esoulmachine#11\u003c/a\u003e from advancedxy/master\u003c/div\u003e","shortMessageMarkdownLink":null,"bodyMessageHtml":"change variable name h to dummy to follow name convention","authors":[{"login":"soulmachine","displayName":"Frank Dai","avatarUrl":"https://avatars.githubusercontent.com/u/620768?v=4","path":"/soulmachine","isGitHub":false}],"committerAttribution":false,"committer":{"login":"soulmachine","displayName":"Frank Dai","avatarUrl":"https://avatars.githubusercontent.com/u/620768?v=4","path":"/soulmachine","isGitHub":false},"parents":["c4f6258881c38744fcb14fae68f02bdeb6531763","c6a7e96beb2f0b0340268c74baa5e54116e06d98"],"globalRelayId":"MDY6Q29tbWl0MjY2MjQzODM6MDFhNTZmNjFlYWQ1MDA0YjYxYjM2ODZkZjVkNTBiODIwOThkNmJjZg==","sha1":"c4f6258881c38744fcb14fae68f02bdeb6531763","sha2":"01a56f61ead5004b61b3686df5d50b82098d6bcf"},"currentUser":null,"repo":{"id":26624383,"defaultBranch":"master","name":"leetcode","ownerLogin":"dotcom900825","currentUserCanPush":false,"isFork":true,"isEmpty":false,"createdAt":"2014-11-14T05:49:21.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/1175408?v=4","public":true,"private":false,"isOrgOwned":false},"diffEntryData":[{"diffLines":[{"stylingDirective":null,"type":"HUNK","blobLineNumber":61,"text":"@@ -62,14 +62,14 @@ \\subsubsection{代码}","html":"@@ -62,14 +62,14 @@ \\subsubsection{代码}","displayNoNewLineWarning":false,"position":0,"left":61,"right":61},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":62,"text":" ListNode *mergeTwoLists(ListNode *l1, ListNode *l2) {","html":" ListNode *mergeTwoLists(ListNode *l1, ListNode *l2) {","displayNoNewLineWarning":false,"position":1,"left":62,"right":62},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":63,"text":" if (l1 == nullptr) return l2;","html":" if (l1 == nullptr) return l2;","displayNoNewLineWarning":false,"position":2,"left":63,"right":63},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":64,"text":" if (l2 == nullptr) return l1;","html":" if (l2 == nullptr) return l1;","displayNoNewLineWarning":false,"position":3,"left":64,"right":64},{"stylingDirective":null,"type":"DELETION","blobLineNumber":65,"text":"- ListNode h(-1);","html":"- ListNode \u003cspan class=\"x x-first x-last\"\u003eh\u003c/span\u003e(-1);","displayNoNewLineWarning":false,"position":4,"left":65,"right":64},{"stylingDirective":null,"type":"DELETION","blobLineNumber":66,"text":"- ListNode *p = \u0026h;","html":"- ListNode *p = \u0026amp;\u003cspan class=\"x x-first x-last\"\u003eh\u003c/span\u003e;","displayNoNewLineWarning":false,"position":5,"left":66,"right":64},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":65,"text":"+ ListNode dummy(-1);","html":"+ ListNode \u003cspan class=\"x x-first x-last\"\u003edummy\u003c/span\u003e(-1);","displayNoNewLineWarning":false,"position":6,"left":66,"right":65},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":66,"text":"+ ListNode *p = \u0026dummy;","html":"+ ListNode *p = \u0026amp;\u003cspan class=\"x x-first x-last\"\u003edummy\u003c/span\u003e;","displayNoNewLineWarning":false,"position":7,"left":66,"right":66},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":67,"text":" for (; l1 != nullptr \u0026\u0026 l2 != nullptr; p = p-\u003enext) {","html":" for (; l1 != nullptr \u0026amp;\u0026amp; l2 != nullptr; p = p-\u0026gt;next) {","displayNoNewLineWarning":false,"position":8,"left":67,"right":67},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":68,"text":" if (l1-\u003eval \u003e l2-\u003eval) { p-\u003enext = l2; l2 = l2-\u003enext; }","html":" if (l1-\u0026gt;val \u0026gt; l2-\u0026gt;val) { p-\u0026gt;next = l2; l2 = l2-\u0026gt;next; }","displayNoNewLineWarning":false,"position":9,"left":68,"right":68},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":69,"text":" else { p-\u003enext = l1; l1 = l1-\u003enext; }","html":" else { p-\u0026gt;next = l1; l1 = l1-\u0026gt;next; }","displayNoNewLineWarning":false,"position":10,"left":69,"right":69},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":70,"text":" }","html":" }","displayNoNewLineWarning":false,"position":11,"left":70,"right":70},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":71,"text":" p-\u003enext = l1 != nullptr ? l1 : l2;","html":" p-\u0026gt;next = l1 != nullptr ? l1 : l2;","displayNoNewLineWarning":false,"position":12,"left":71,"right":71},{"stylingDirective":null,"type":"DELETION","blobLineNumber":72,"text":"- return h.next;","html":"- return \u003cspan class=\"x x-first x-last\"\u003eh\u003c/span\u003e.next;","displayNoNewLineWarning":false,"position":13,"left":72,"right":71},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":72,"text":"+ return dummy.next;","html":"+ return \u003cspan class=\"x x-first x-last\"\u003edummy\u003c/span\u003e.next;","displayNoNewLineWarning":false,"position":14,"left":72,"right":72},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":73,"text":" }","html":" }","displayNoNewLineWarning":false,"position":15,"left":73,"right":73},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":74,"text":" };","html":" };","displayNoNewLineWarning":false,"position":16,"left":74,"right":74},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":75,"text":" \\end{Code}","html":" \u003cspan class=\"pl-c1\"\u003e\\end\u003c/span\u003e{\u003cspan class=\"pl-smi\"\u003eCode\u003c/span\u003e}","displayNoNewLineWarning":false,"position":17,"left":75,"right":75}],"diffNumber":0,"diffSize":"0 Bytes","isBinary":false,"isTooBig":false,"collapsed":false,"isSubmodule":false,"lineCount":423,"linesChanged":6,"newTreeEntry":{"lineCount":423,"path":"C++/chapSorting.tex","mode":100644,"isGenerated":false},"oldTreeEntry":{"lineCount":0,"path":"C++/chapSorting.tex","mode":100644},"linesAdded":3,"linesDeleted":3,"path":"C++/chapSorting.tex","pathDigest":"d823c26bb1922b1c450cec907c727b252b17e2a23aa039bd9dd18278117b3690","status":"MODIFIED","truncatedReason":null,"oldOid":"c4f6258881c38744fcb14fae68f02bdeb6531763","newOid":"01a56f61ead5004b61b3686df5d50b82098d6bcf","copilotChatReference":null,"deletedSha":"c4f6258881c38744fcb14fae68f02bdeb6531763","canToggleRichDiff":false,"defaultToRichDiff":false,"proseDifffHtml":null,"renderInfo":null,"dependencyDiffPath":null,"submodule":null}],"splitViewPreference":"unified","ignoreWhitespace":false,"commentsPreference":"visible","diffLineSpacingPreference":"relaxed","useMonospaceFont":false,"pasteUrlLinkAsPlainText":false,"userNotices":[],"path":"/dotcom900825/leetcode/commit/01a56f61ead5004b61b3686df5d50b82098d6bcf","fileTreeExpanded":true,"headerInfo":{"additions":3,"deletions":3,"filesChanged":1,"filesChangedString":"1"},"moreDiffsToLoad":false,"asyncDiffLoadInfo":{"startIndex":1,"truncated":false,"byteCount":604,"lineShownCount":18},"commentInfo":{"canComment":false,"locked":false,"canLock":false,"repoArchived":false},"csrf_tokens":{"/users/diffview?diff=split":{"post":"akIPs1yNHU0tD_iKWxGF1hDK6aqyzuTOVBSvKJn05DdMc2EUlaiVKPPzE7V5mNBqO1aNas6P6I1WsMISxn3OIA"},"/users/diffview?diff=unified":{"post":"kdvaPsmBDI3CDPVyboosdh_bODFN_tjPaCWgYcPf1mG36rSZAKSE6BzwHk1MA3nKNEdc8TG_1Ixqgc1bnFb8dg"},"/notifications/thread":{"post":"rBJe9S_ntAxu2FEbRCE4yZDaW0sq2D1yYiBB0xcVPT0kZoR2bUTQc7hn_En8IOkh0UPzrRR98-C6Z_chYB7Q3A"}}},"title":"Merge pull request #11 from advancedxy/master · dotcom900825/leetcode@01a56f6","appPayload":{"helpUrl":"https://docs.github.com","findInDiffWorkerPath":"/assets-cdn/worker/find-in-diff-worker-f6b2312e7da9.js","enabled_features":{"diff_ux_refresh_beta":false,"diff_inline_comments":false,"diff_ux_refresh_ssr_five":false,"diff_ux_refresh_ssr_ten":false}}}

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)
0