{"action":"created","comment":{"url":"https://api.github.com/repos/nodejs/node/pulls/comments/39040027","id":39040027,"diff_hunk":"@@ -504,19 +504,17 @@ ClientRequest.prototype._deferToConnect = function(method, arguments_, cb) {\n   // in the future (when a socket gets assigned out of the pool and is\n   // eventually writable).\n   var self = this;\n+  var callSocketMethod = function() {","path":"lib/_http_client.js","position":4,"original_position":4,"commit_id":"073ec80dedda21849a10b08b18784cdea0ac0250","original_commit_id":"073ec80dedda21849a10b08b18784cdea0ac0250","user":{"login":"cjihrig","id":2512748,"avatar_url":"https://avatars.githubusercontent.com/u/2512748?v=3","gravatar_id":"","url":"https://api.github.com/users/cjihrig","html_url":"https://github.com/cjihrig","followers_url":"https://api.github.com/users/cjihrig/followers","following_url":"https://api.github.com/users/cjihrig/following{/other_user}","gists_url":"https://api.github.com/users/cjihrig/gists{/gist_id}","starred_url":"https://api.github.com/users/cjihrig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cjihrig/subscriptions","organizations_url":"https://api.github.com/users/cjihrig/orgs","repos_url":"https://api.github.com/users/cjihrig/repos","events_url":"https://api.github.com/users/cjihrig/events{/privacy}","received_events_url":"https://api.github.com/users/cjihrig/received_events","type":"User","site_admin":false},"body":"Can you make this `function callSocketMethod()`","created_at":"2015-09-09T13:17:33Z","updated_at":"2015-09-09T13:17:33Z","html_url":"https://github.com/nodejs/node/pull/2769#discussion_r39040027","pull_request_url":"https://api.github.com/repos/nodejs/node/pulls/2769","_links":{"self":{"href":"https://api.github.com/repos/nodejs/node/pulls/comments/39040027"},"html":{"href":"https://github.com/nodejs/node/pull/2769#discussion_r39040027"},"pull_request":{"href":"https://api.github.com/repos/nodejs/node/pulls/2769"}}},"pull_request":{"url":"https://api.github.com/repos/nodejs/node/pulls/2769","id":44547788,"html_url":"https://github.com/nodejs/node/pull/2769","diff_url":"https://github.com/nodejs/node/pull/2769.diff","patch_url":"https://github.com/nodejs/node/pull/2769.patch","issue_url":"https://api.github.com/repos/nodejs/node/issues/2769","number":2769,"state":"open","locked":false,"title":"http: DRY ClientRequest.prototype._deferToConnect","user":{"login":"ahoym","id":5249615,"avatar_url":"https://avatars.githubusercontent.com/u/5249615?v=3","gravatar_id":"","url":"https://api.github.com/users/ahoym","html_url":"https://github.com/ahoym","followers_url":"https://api.github.com/users/ahoym/followers","following_url":"https://api.github.com/users/ahoym/following{/other_user}","gists_url":"https://api.github.com/users/ahoym/gists{/gist_id}","starred_url":"https://api.github.com/users/ahoym/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahoym/subscriptions","organizations_url":"https://api.github.com/users/ahoym/orgs","repos_url":"https://api.github.com/users/ahoym/repos","events_url":"https://api.github.com/users/ahoym/events{/privacy}","received_events_url":"https://api.github.com/users/ahoym/received_events","type":"User","site_admin":false},"body":"Came across some repetitive lines when reviewing code.\r\n\r\nLogic for calling the passed in socket `method` and/or `cb` was duplicated. Extracted these calls into a separate function, `callSocketMethod`, and invoked this new function in place of the replaced code.","created_at":"2015-09-09T13:14:34Z","updated_at":"2015-09-09T13:17:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fb75ed08300e12b48410e7bcdf4613268ddb97e2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/nodejs/node/pulls/2769/commits","review_comments_url":"https://api.github.com/repos/nodejs/node/pulls/2769/comments","review_comment_url":"https://api.github.com/repos/nodejs/node/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nodejs/node/issues/2769/comments","statuses_url":"https://api.github.com/repos/nodejs/node/statuses/073ec80dedda21849a10b08b18784cdea0ac0250","head":{"label":"ahoym:DRY-ClientRequest-_deferToConnect","ref":"DRY-ClientRequest-_deferToConnect","sha":"073ec80dedda21849a10b08b18784cdea0ac0250","user":{"login":"ahoym","id":5249615,"avatar_url":"https://avatars.githubusercontent.com/u/5249615?v=3","gravatar_id":"","url":"https://api.github.com/users/ahoym","html_url":"https://github.com/ahoym","followers_url":"https://api.github.com/users/ahoym/followers","following_url":"https://api.github.com/users/ahoym/following{/other_user}","gists_url":"https://api.github.com/users/ahoym/gists{/gist_id}","starred_url":"https://api.github.com/users/ahoym/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahoym/subscriptions","organizations_url":"https://api.github.com/users/ahoym/orgs","repos_url":"https://api.github.com/users/ahoym/repos","events_url":"https://api.github.com/users/ahoym/events{/privacy}","received_events_url":"https://api.github.com/users/ahoym/received_events","type":"User","site_admin":false},"repo":{"id":42176239,"name":"node","full_name":"ahoym/node","owner":{"login":"ahoym","id":5249615,"avatar_url":"https://avatars.githubusercontent.com/u/5249615?v=3","gravatar_id":"","url":"https://api.github.com/users/ahoym","html_url":"https://github.com/ahoym","followers_url":"https://api.github.com/users/ahoym/followers","following_url":"https://api.github.com/users/ahoym/following{/other_user}","gists_url":"https://api.github.com/users/ahoym/gists{/gist_id}","starred_url":"https://api.github.com/users/ahoym/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahoym/subscriptions","organizations_url":"https://api.github.com/users/ahoym/orgs","repos_url":"https://api.github.com/users/ahoym/repos","events_url":"https://api.github.com/users/ahoym/events{/privacy}","received_events_url":"https://api.github.com/users/ahoym/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ahoym/node","description":"✨Future Node.js releases will be from this repo. ✨","fork":true,"url":"https://api.github.com/repos/ahoym/node","forks_url":"https://api.github.com/repos/ahoym/node/forks","keys_url":"https://api.github.com/repos/ahoym/node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ahoym/node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ahoym/node/teams","hooks_url":"https://api.github.com/repos/ahoym/node/hooks","issue_events_url":"https://api.github.com/repos/ahoym/node/issues/events{/number}","events_url":"https://api.github.com/repos/ahoym/node/events","assignees_url":"https://api.github.com/repos/ahoym/node/assignees{/user}","branches_url":"https://api.github.com/repos/ahoym/node/branches{/branch}","tags_url":"https://api.github.com/repos/ahoym/node/tags","blobs_url":"https://api.github.com/repos/ahoym/node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ahoym/node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ahoym/node/git/refs{/sha}","trees_url":"https://api.github.com/repos/ahoym/node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ahoym/node/statuses/{sha}","languages_url":"https://api.github.com/repos/ahoym/node/languages","stargazers_url":"https://api.github.com/repos/ahoym/node/stargazers","contributors_url":"https://api.github.com/repos/ahoym/node/contributors","subscribers_url":"https://api.github.com/repos/ahoym/node/subscribers","subscription_url":"https://api.github.com/repos/ahoym/node/subscription","commits_url":"https://api.github.com/repos/ahoym/node/commits{/sha}","git_commits_url":"https://api.github.com/repos/ahoym/node/git/commits{/sha}","comments_url":"https://api.github.com/repos/ahoym/node/comments{/number}","issue_comment_url":"https://api.github.com/repos/ahoym/node/issues/comments{/number}","contents_url":"https://api.github.com/repos/ahoym/node/contents/{+path}","compare_url":"https://api.github.com/repos/ahoym/node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ahoym/node/merges","archive_url":"https://api.github.com/repos/ahoym/node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ahoym/node/downloads","issues_url":"https://api.github.com/repos/ahoym/node/issues{/number}","pulls_url":"https://api.github.com/repos/ahoym/node/pulls{/number}","milestones_url":"https://api.github.com/repos/ahoym/node/milestones{/number}","notifications_url":"https://api.github.com/repos/ahoym/node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ahoym/node/labels{/name}","releases_url":"https://api.github.com/repos/ahoym/node/releases{/id}","created_at":"2015-09-09T12:12:32Z","updated_at":"2015-09-09T12:12:36Z","pushed_at":"2015-09-09T13:11:37Z","git_url":"git://github.com/ahoym/node.git","ssh_url":"git@github.com:ahoym/node.git","clone_url":"https://github.com/ahoym/node.git","svn_url":"https://github.com/ahoym/node","homepage":"https://nodejs.org","size":205063,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"nodejs:master","ref":"master","sha":"f8152df5e815c98be702fe58753258b58f02c4ad","user":{"login":"nodejs","id":9950313,"avatar_url":"https://avatars.githubusercontent.com/u/9950313?v=3","gravatar_id":"","url":"https://api.github.com/users/nodejs","html_url":"https://github.com/nodejs","followers_url":"https://api.github.com/users/nodejs/followers","following_url":"https://api.github.com/users/nodejs/following{/other_user}","gists_url":"https://api.github.com/users/nodejs/gists{/gist_id}","starred_url":"https://api.github.com/users/nodejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nodejs/subscriptions","organizations_url":"https://api.github.com/users/nodejs/orgs","repos_url":"https://api.github.com/users/nodejs/repos","events_url":"https://api.github.com/users/nodejs/events{/privacy}","received_events_url":"https://api.github.com/users/nodejs/received_events","type":"Organization","site_admin":false},"repo":{"id":27193779,"name":"node","full_name":"nodejs/node","owner":{"login":"nodejs","id":9950313,"avatar_url":"https://avatars.githubusercontent.com/u/9950313?v=3","gravatar_id":"","url":"https://api.github.com/users/nodejs","html_url":"https://github.com/nodejs","followers_url":"https://api.github.com/users/nodejs/followers","following_url":"https://api.github.com/users/nodejs/following{/other_user}","gists_url":"https://api.github.com/users/nodejs/gists{/gist_id}","starred_url":"https://api.github.com/users/nodejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nodejs/subscriptions","organizations_url":"https://api.github.com/users/nodejs/orgs","repos_url":"https://api.github.com/users/nodejs/repos","events_url":"https://api.github.com/users/nodejs/events{/privacy}","received_events_url":"https://api.github.com/users/nodejs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nodejs/node","description":"✨Future Node.js releases will be from this repo. ✨","fork":false,"url":"https://api.github.com/repos/nodejs/node","forks_url":"https://api.github.com/repos/nodejs/node/forks","keys_url":"https://api.github.com/repos/nodejs/node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nodejs/node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nodejs/node/teams","hooks_url":"https://api.github.com/repos/nodejs/node/hooks","issue_events_url":"https://api.github.com/repos/nodejs/node/issues/events{/number}","events_url":"https://api.github.com/repos/nodejs/node/events","assignees_url":"https://api.github.com/repos/nodejs/node/assignees{/user}","branches_url":"https://api.github.com/repos/nodejs/node/branches{/branch}","tags_url":"https://api.github.com/repos/nodejs/node/tags","blobs_url":"https://api.github.com/repos/nodejs/node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nodejs/node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nodejs/node/git/refs{/sha}","trees_url":"https://api.github.com/repos/nodejs/node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nodejs/node/statuses/{sha}","languages_url":"https://api.github.com/repos/nodejs/node/languages","stargazers_url":"https://api.github.com/repos/nodejs/node/stargazers","contributors_url":"https://api.github.com/repos/nodejs/node/contributors","subscribers_url":"https://api.github.com/repos/nodejs/node/subscribers","subscription_url":"https://api.github.com/repos/nodejs/node/subscription","commits_url":"https://api.github.com/repos/nodejs/node/commits{/sha}","git_commits_url":"https://api.github.com/repos/nodejs/node/git/commits{/sha}","comments_url":"https://api.github.com/repos/nodejs/node/comments{/number}","issue_comment_url":"https://api.github.com/repos/nodejs/node/issues/comments{/number}","contents_url":"https://api.github.com/repos/nodejs/node/contents/{+path}","compare_url":"https://api.github.com/repos/nodejs/node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nodejs/node/merges","archive_url":"https://api.github.com/repos/nodejs/node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nodejs/node/downloads","issues_url":"https://api.github.com/repos/nodejs/node/issues{/number}","pulls_url":"https://api.github.com/repos/nodejs/node/pulls{/number}","milestones_url":"https://api.github.com/repos/nodejs/node/milestones{/number}","notifications_url":"https://api.github.com/repos/nodejs/node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nodejs/node/labels{/name}","releases_url":"https://api.github.com/repos/nodejs/node/releases{/id}","created_at":"2014-11-26T19:57:11Z","updated_at":"2015-09-09T13:17:31Z","pushed_at":"2015-09-09T13:14:35Z","git_url":"git://github.com/nodejs/node.git","ssh_url":"git@github.com:nodejs/node.git","clone_url":"https://github.com/nodejs/node.git","svn_url":"https://github.com/nodejs/node","homepage":"https://nodejs.org","size":205063,"stargazers_count":14260,"watchers_count":14260,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1208,"mirror_url":null,"open_issues_count":378,"forks":1208,"open_issues":378,"watchers":14260,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nodejs/node/pulls/2769"},"html":{"href":"https://github.com/nodejs/node/pull/2769"},"issue":{"href":"https://api.github.com/repos/nodejs/node/issues/2769"},"comments":{"href":"https://api.github.com/repos/nodejs/node/issues/2769/comments"},"review_comments":{"href":"https://api.github.com/repos/nodejs/node/pulls/2769/comments"},"review_comment":{"href":"https://api.github.com/repos/nodejs/node/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nodejs/node/pulls/2769/commits"},"statuses":{"href":"https://api.github.com/repos/nodejs/node/statuses/073ec80dedda21849a10b08b18784cdea0ac0250"}}}}