{"action":"created","comment":{"url":"https://api.github.com/repos/nats-io/gnatsd/pulls/comments/65816653","id":65816653,"diff_hunk":"@@ -797,12 +797,6 @@ func (c *client) processMsg(msg []byte) {\n \t// Snapshot server.\n \tsrv := c.srv\n \n-\t// Create cache subs map if needed.\n-\tif c.cache.results == nil && srv != nil {","path":"server/client.go","position":5,"original_position":5,"commit_id":"6715821140ddb278c3980a93194a96c4108f3c65","original_commit_id":"6715821140ddb278c3980a93194a96c4108f3c65","user":{"login":"nuss-justin","id":6443781,"avatar_url":"https://avatars.githubusercontent.com/u/6443781?v=3","gravatar_id":"","url":"https://api.github.com/users/nuss-justin","html_url":"https://github.com/nuss-justin","followers_url":"https://api.github.com/users/nuss-justin/followers","following_url":"https://api.github.com/users/nuss-justin/following{/other_user}","gists_url":"https://api.github.com/users/nuss-justin/gists{/gist_id}","starred_url":"https://api.github.com/users/nuss-justin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nuss-justin/subscriptions","organizations_url":"https://api.github.com/users/nuss-justin/orgs","repos_url":"https://api.github.com/users/nuss-justin/repos","events_url":"https://api.github.com/users/nuss-justin/events{/privacy}","received_events_url":"https://api.github.com/users/nuss-justin/received_events","type":"User","site_admin":false},"body":"The if is completly in line 829. srv can never be nil after line 819 and event if it is we will return without processing the message, so we don't even need to initialize the cache. ","created_at":"2016-06-05T12:26:56Z","updated_at":"2016-06-05T12:26:56Z","html_url":"https://github.com/nats-io/gnatsd/pull/293#discussion_r65816653","pull_request_url":"https://api.github.com/repos/nats-io/gnatsd/pulls/293","_links":{"self":{"href":"https://api.github.com/repos/nats-io/gnatsd/pulls/comments/65816653"},"html":{"href":"https://github.com/nats-io/gnatsd/pull/293#discussion_r65816653"},"pull_request":{"href":"https://api.github.com/repos/nats-io/gnatsd/pulls/293"}}},"pull_request":{"url":"https://api.github.com/repos/nats-io/gnatsd/pulls/293","id":72628016,"html_url":"https://github.com/nats-io/gnatsd/pull/293","diff_url":"https://github.com/nats-io/gnatsd/pull/293.diff","patch_url":"https://github.com/nats-io/gnatsd/pull/293.patch","issue_url":"https://api.github.com/repos/nats-io/gnatsd/issues/293","number":293,"state":"open","locked":false,"title":"Simplify processMsg","user":{"login":"nuss-justin","id":6443781,"avatar_url":"https://avatars.githubusercontent.com/u/6443781?v=3","gravatar_id":"","url":"https://api.github.com/users/nuss-justin","html_url":"https://github.com/nuss-justin","followers_url":"https://api.github.com/users/nuss-justin/followers","following_url":"https://api.github.com/users/nuss-justin/following{/other_user}","gists_url":"https://api.github.com/users/nuss-justin/gists{/gist_id}","starred_url":"https://api.github.com/users/nuss-justin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nuss-justin/subscriptions","organizations_url":"https://api.github.com/users/nuss-justin/orgs","repos_url":"https://api.github.com/users/nuss-justin/repos","events_url":"https://api.github.com/users/nuss-justin/events{/privacy}","received_events_url":"https://api.github.com/users/nuss-justin/received_events","type":"User","site_admin":false},"body":"This commit has 3 changes:\r\n\r\n- Remove duplicate logic for creating cache results map.\r\n- Move code out of an if that will always be true and remove the if.\r\n- Use == 0 instead of <= 0 for comparing the return value of len(X) as the value can never be < 0.","created_at":"2016-06-05T12:23:55Z","updated_at":"2016-06-05T12:26:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"de845491a262ac6dc5e7bde38fa5783e4a614788","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/nats-io/gnatsd/pulls/293/commits","review_comments_url":"https://api.github.com/repos/nats-io/gnatsd/pulls/293/comments","review_comment_url":"https://api.github.com/repos/nats-io/gnatsd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nats-io/gnatsd/issues/293/comments","statuses_url":"https://api.github.com/repos/nats-io/gnatsd/statuses/6715821140ddb278c3980a93194a96c4108f3c65","head":{"label":"nuss-justin:simplify-processmsg","ref":"simplify-processmsg","sha":"6715821140ddb278c3980a93194a96c4108f3c65","user":{"login":"nuss-justin","id":6443781,"avatar_url":"https://avatars.githubusercontent.com/u/6443781?v=3","gravatar_id":"","url":"https://api.github.com/users/nuss-justin","html_url":"https://github.com/nuss-justin","followers_url":"https://api.github.com/users/nuss-justin/followers","following_url":"https://api.github.com/users/nuss-justin/following{/other_user}","gists_url":"https://api.github.com/users/nuss-justin/gists{/gist_id}","starred_url":"https://api.github.com/users/nuss-justin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nuss-justin/subscriptions","organizations_url":"https://api.github.com/users/nuss-justin/orgs","repos_url":"https://api.github.com/users/nuss-justin/repos","events_url":"https://api.github.com/users/nuss-justin/events{/privacy}","received_events_url":"https://api.github.com/users/nuss-justin/received_events","type":"User","site_admin":false},"repo":{"id":60458541,"name":"gnatsd","full_name":"nuss-justin/gnatsd","owner":{"login":"nuss-justin","id":6443781,"avatar_url":"https://avatars.githubusercontent.com/u/6443781?v=3","gravatar_id":"","url":"https://api.github.com/users/nuss-justin","html_url":"https://github.com/nuss-justin","followers_url":"https://api.github.com/users/nuss-justin/followers","following_url":"https://api.github.com/users/nuss-justin/following{/other_user}","gists_url":"https://api.github.com/users/nuss-justin/gists{/gist_id}","starred_url":"https://api.github.com/users/nuss-justin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nuss-justin/subscriptions","organizations_url":"https://api.github.com/users/nuss-justin/orgs","repos_url":"https://api.github.com/users/nuss-justin/repos","events_url":"https://api.github.com/users/nuss-justin/events{/privacy}","received_events_url":"https://api.github.com/users/nuss-justin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nuss-justin/gnatsd","description":"High-Performance server for NATS, the cloud native messaging system.","fork":true,"url":"https://api.github.com/repos/nuss-justin/gnatsd","forks_url":"https://api.github.com/repos/nuss-justin/gnatsd/forks","keys_url":"https://api.github.com/repos/nuss-justin/gnatsd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nuss-justin/gnatsd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nuss-justin/gnatsd/teams","hooks_url":"https://api.github.com/repos/nuss-justin/gnatsd/hooks","issue_events_url":"https://api.github.com/repos/nuss-justin/gnatsd/issues/events{/number}","events_url":"https://api.github.com/repos/nuss-justin/gnatsd/events","assignees_url":"https://api.github.com/repos/nuss-justin/gnatsd/assignees{/user}","branches_url":"https://api.github.com/repos/nuss-justin/gnatsd/branches{/branch}","tags_url":"https://api.github.com/repos/nuss-justin/gnatsd/tags","blobs_url":"https://api.github.com/repos/nuss-justin/gnatsd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nuss-justin/gnatsd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nuss-justin/gnatsd/git/refs{/sha}","trees_url":"https://api.github.com/repos/nuss-justin/gnatsd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nuss-justin/gnatsd/statuses/{sha}","languages_url":"https://api.github.com/repos/nuss-justin/gnatsd/languages","stargazers_url":"https://api.github.com/repos/nuss-justin/gnatsd/stargazers","contributors_url":"https://api.github.com/repos/nuss-justin/gnatsd/contributors","subscribers_url":"https://api.github.com/repos/nuss-justin/gnatsd/subscribers","subscription_url":"https://api.github.com/repos/nuss-justin/gnatsd/subscription","commits_url":"https://api.github.com/repos/nuss-justin/gnatsd/commits{/sha}","git_commits_url":"https://api.github.com/repos/nuss-justin/gnatsd/git/commits{/sha}","comments_url":"https://api.github.com/repos/nuss-justin/gnatsd/comments{/number}","issue_comment_url":"https://api.github.com/repos/nuss-justin/gnatsd/issues/comments{/number}","contents_url":"https://api.github.com/repos/nuss-justin/gnatsd/contents/{+path}","compare_url":"https://api.github.com/repos/nuss-justin/gnatsd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nuss-justin/gnatsd/merges","archive_url":"https://api.github.com/repos/nuss-justin/gnatsd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nuss-justin/gnatsd/downloads","issues_url":"https://api.github.com/repos/nuss-justin/gnatsd/issues{/number}","pulls_url":"https://api.github.com/repos/nuss-justin/gnatsd/pulls{/number}","milestones_url":"https://api.github.com/repos/nuss-justin/gnatsd/milestones{/number}","notifications_url":"https://api.github.com/repos/nuss-justin/gnatsd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nuss-justin/gnatsd/labels{/name}","releases_url":"https://api.github.com/repos/nuss-justin/gnatsd/releases{/id}","deployments_url":"https://api.github.com/repos/nuss-justin/gnatsd/deployments","created_at":"2016-06-05T12:17:54Z","updated_at":"2016-06-05T12:17:55Z","pushed_at":"2016-06-05T12:23:06Z","git_url":"git://github.com/nuss-justin/gnatsd.git","ssh_url":"git@github.com:nuss-justin/gnatsd.git","clone_url":"https://github.com/nuss-justin/gnatsd.git","svn_url":"https://github.com/nuss-justin/gnatsd","homepage":"https://nats.io","size":1287,"stargazers_count":0,"watchers_count":0,"language":"Go","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":"nats-io:master","ref":"master","sha":"249173d331ace1ac5cf51002e14081a592f8ddc7","user":{"login":"nats-io","id":10203055,"avatar_url":"https://avatars.githubusercontent.com/u/10203055?v=3","gravatar_id":"","url":"https://api.github.com/users/nats-io","html_url":"https://github.com/nats-io","followers_url":"https://api.github.com/users/nats-io/followers","following_url":"https://api.github.com/users/nats-io/following{/other_user}","gists_url":"https://api.github.com/users/nats-io/gists{/gist_id}","starred_url":"https://api.github.com/users/nats-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nats-io/subscriptions","organizations_url":"https://api.github.com/users/nats-io/orgs","repos_url":"https://api.github.com/users/nats-io/repos","events_url":"https://api.github.com/users/nats-io/events{/privacy}","received_events_url":"https://api.github.com/users/nats-io/received_events","type":"Organization","site_admin":false},"repo":{"id":6443435,"name":"gnatsd","full_name":"nats-io/gnatsd","owner":{"login":"nats-io","id":10203055,"avatar_url":"https://avatars.githubusercontent.com/u/10203055?v=3","gravatar_id":"","url":"https://api.github.com/users/nats-io","html_url":"https://github.com/nats-io","followers_url":"https://api.github.com/users/nats-io/followers","following_url":"https://api.github.com/users/nats-io/following{/other_user}","gists_url":"https://api.github.com/users/nats-io/gists{/gist_id}","starred_url":"https://api.github.com/users/nats-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nats-io/subscriptions","organizations_url":"https://api.github.com/users/nats-io/orgs","repos_url":"https://api.github.com/users/nats-io/repos","events_url":"https://api.github.com/users/nats-io/events{/privacy}","received_events_url":"https://api.github.com/users/nats-io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nats-io/gnatsd","description":"High-Performance server for NATS, the cloud native messaging system.","fork":false,"url":"https://api.github.com/repos/nats-io/gnatsd","forks_url":"https://api.github.com/repos/nats-io/gnatsd/forks","keys_url":"https://api.github.com/repos/nats-io/gnatsd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nats-io/gnatsd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nats-io/gnatsd/teams","hooks_url":"https://api.github.com/repos/nats-io/gnatsd/hooks","issue_events_url":"https://api.github.com/repos/nats-io/gnatsd/issues/events{/number}","events_url":"https://api.github.com/repos/nats-io/gnatsd/events","assignees_url":"https://api.github.com/repos/nats-io/gnatsd/assignees{/user}","branches_url":"https://api.github.com/repos/nats-io/gnatsd/branches{/branch}","tags_url":"https://api.github.com/repos/nats-io/gnatsd/tags","blobs_url":"https://api.github.com/repos/nats-io/gnatsd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nats-io/gnatsd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nats-io/gnatsd/git/refs{/sha}","trees_url":"https://api.github.com/repos/nats-io/gnatsd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nats-io/gnatsd/statuses/{sha}","languages_url":"https://api.github.com/repos/nats-io/gnatsd/languages","stargazers_url":"https://api.github.com/repos/nats-io/gnatsd/stargazers","contributors_url":"https://api.github.com/repos/nats-io/gnatsd/contributors","subscribers_url":"https://api.github.com/repos/nats-io/gnatsd/subscribers","subscription_url":"https://api.github.com/repos/nats-io/gnatsd/subscription","commits_url":"https://api.github.com/repos/nats-io/gnatsd/commits{/sha}","git_commits_url":"https://api.github.com/repos/nats-io/gnatsd/git/commits{/sha}","comments_url":"https://api.github.com/repos/nats-io/gnatsd/comments{/number}","issue_comment_url":"https://api.github.com/repos/nats-io/gnatsd/issues/comments{/number}","contents_url":"https://api.github.com/repos/nats-io/gnatsd/contents/{+path}","compare_url":"https://api.github.com/repos/nats-io/gnatsd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nats-io/gnatsd/merges","archive_url":"https://api.github.com/repos/nats-io/gnatsd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nats-io/gnatsd/downloads","issues_url":"https://api.github.com/repos/nats-io/gnatsd/issues{/number}","pulls_url":"https://api.github.com/repos/nats-io/gnatsd/pulls{/number}","milestones_url":"https://api.github.com/repos/nats-io/gnatsd/milestones{/number}","notifications_url":"https://api.github.com/repos/nats-io/gnatsd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nats-io/gnatsd/labels{/name}","releases_url":"https://api.github.com/repos/nats-io/gnatsd/releases{/id}","deployments_url":"https://api.github.com/repos/nats-io/gnatsd/deployments","created_at":"2012-10-29T16:12:24Z","updated_at":"2016-06-05T06:36:08Z","pushed_at":"2016-06-05T12:23:55Z","git_url":"git://github.com/nats-io/gnatsd.git","ssh_url":"git@github.com:nats-io/gnatsd.git","clone_url":"https://github.com/nats-io/gnatsd.git","svn_url":"https://github.com/nats-io/gnatsd","homepage":"https://nats.io","size":1700,"stargazers_count":2137,"watchers_count":2137,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":249,"mirror_url":null,"open_issues_count":17,"forks":249,"open_issues":17,"watchers":2137,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nats-io/gnatsd/pulls/293"},"html":{"href":"https://github.com/nats-io/gnatsd/pull/293"},"issue":{"href":"https://api.github.com/repos/nats-io/gnatsd/issues/293"},"comments":{"href":"https://api.github.com/repos/nats-io/gnatsd/issues/293/comments"},"review_comments":{"href":"https://api.github.com/repos/nats-io/gnatsd/pulls/293/comments"},"review_comment":{"href":"https://api.github.com/repos/nats-io/gnatsd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nats-io/gnatsd/pulls/293/commits"},"statuses":{"href":"https://api.github.com/repos/nats-io/gnatsd/statuses/6715821140ddb278c3980a93194a96c4108f3c65"}}}}
{"actor":{"display_login":"nuss-justin"}}