GitHub PullRequestReviewCommentEvent at 2014-04-03 23:08:15
Repository: go-nsq
Actor: mreiferson
Payload: {"comment":{"url":"https://api.github.com/repos/bitly/go-nsq/pulls/comments/11277380","id":11277380,"diff_hunk":"@@ -1030,20 +1035,25 @@ func (q *Reader) rdyLoop() {\n \tfor {\n \t\tselect {\n \t\tcase <-backoffTimerChan:\n+\t\t\tvar choice *nsqConn\n+\n \t\t\tq.RLock()\n \t\t\t// pick a random connection to test the waters\n-\t\t\tchoice := rand.Intn(len(q.nsqConnections))\n-\t\t\ti := 0\n+\t\t\tvar i int\n+\t\t\tidx := rand.Intn(len(q.nsqConnections))\n \t\t\tfor _, c := range q.nsqConnections {\n-\t\t\t\tif i != choice {\n+\t\t\t\tif i == idx {\n \t\t\t\t\ti++","path":"reader.go","position":77,"original_position":121,"commit_id":"f93eaf6943ed08a7fd4ec8d3554b4d2d14260de1","original_commit_id":"1083ef129f03c5cdfa4c5bd4efcc9e326e6d2eaa","user":{"login":"mreiferson","id":187441,"avatar_url":"https://avatars.githubusercontent.com/u/187441?","gravatar_id":"dd56a8e1de66aeedb987397511f830e7","url":"https://api.github.com/users/mreiferson","html_url":"https://github.com/mreiferson","followers_url":"https://api.github.com/users/mreiferson/followers","following_url":"https://api.github.com/users/mreiferson/following{/other_user}","gists_url":"https://api.github.com/users/mreiferson/gists{/gist_id}","starred_url":"https://api.github.com/users/mreiferson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mreiferson/subscriptions","organizations_url":"https://api.github.com/users/mreiferson/orgs","repos_url":"https://api.github.com/users/mreiferson/repos","events_url":"https://api.github.com/users/mreiferson/events{/privacy}","received_events_url":"https://api.github.com/users/mreiferson/received_events","type":"User","site_admin":false},"body":"actually, the only edge case where this would be possible would be if # of connections is zero... I'll add a check","created_at":"2014-04-03T23:08:15Z","updated_at":"2014-04-03T23:08:15Z","html_url":"https://github.com/bitly/go-nsq/pull/29#discussion_r11277380","pull_request_url":"https://api.github.com/repos/bitly/go-nsq/pulls/29","_links":{"self":{"href":"https://api.github.com/repos/bitly/go-nsq/pulls/comments/11277380"},"html":{"href":"https://github.com/bitly/go-nsq/pull/29#discussion_r11277380"},"pull_request":{"href":"https://api.github.com/repos/bitly/go-nsq/pulls/29"}}}}