{"action":"created","comment":{"url":"https://api.github.com/repos/uber/ringpop-go/pulls/comments/91941605","pull_request_review_id":12449285,"id":91941605,"diff_hunk":"@@ -234,55 +247,88 @@ func (t *redBlackTree) Delete(val int) bool {\n \treturn found != nil\n }\n \n-func (n *redBlackNode) search(val int) (string, bool) {\n-\tif n.val == val {\n-\t\treturn n.str, true\n-\t} else if val < n.val {\n+func (n *redBlackNode) search(key keytype) (valuetype, bool) {\n+\tcmp := n.key.Compare(key)\n+\tif cmp == 0 {\n+\t\treturn n.value, true\n+\t} else if 0 < cmp {\n \t\tif n.left != nil {\n-\t\t\treturn n.left.search(val)\n+\t\t\treturn n.left.search(key)\n \t\t}\n \t} else if n.right != nil {\n-\t\treturn n.right.search(val)\n+\t\treturn n.right.search(key)\n+\t}\n+\treturn nil, false\n+}\n+\n+// walk Walks the tree in sorted order invoking `walker` for each node. If the\n+// walker function returns `false`, walking is stopped and no more nodes will be\n+// visited. Returns `true` if all nodes are visited; `false` if not.\n+func (n *redBlackNode) walk(walker func(*redBlackNode) bool) bool {","path":"hashring/rbtree.go","position":116,"original_position":116,"commit_id":"5e842dae9b379c936e42da276622d21f86fe0ded","original_commit_id":"5e842dae9b379c936e42da276622d21f86fe0ded","user":{"login":"mennopruijssers","id":831983,"avatar_url":"https://avatars.githubusercontent.com/u/831983?v=3","gravatar_id":"","url":"https://api.github.com/users/mennopruijssers","html_url":"https://github.com/mennopruijssers","followers_url":"https://api.github.com/users/mennopruijssers/followers","following_url":"https://api.github.com/users/mennopruijssers/following{/other_user}","gists_url":"https://api.github.com/users/mennopruijssers/gists{/gist_id}","starred_url":"https://api.github.com/users/mennopruijssers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mennopruijssers/subscriptions","organizations_url":"https://api.github.com/users/mennopruijssers/orgs","repos_url":"https://api.github.com/users/mennopruijssers/repos","events_url":"https://api.github.com/users/mennopruijssers/events{/privacy}","received_events_url":"https://api.github.com/users/mennopruijssers/received_events","type":"User","site_admin":false},"body":"`All`, and `Every` doesn't cover the behaviour since it breaks out of the loop if `walker` return `false`.\r\n`Traverse` or `TraverseUntil` with a `condition`-argument might make more sense...\r\n@thanodnl thoughts?","created_at":"2016-12-12T13:00:14Z","updated_at":"2016-12-12T13:00:40Z","html_url":"https://github.com/uber/ringpop-go/pull/188#discussion_r91941605","pull_request_url":"https://api.github.com/repos/uber/ringpop-go/pulls/188","_links":{"self":{"href":"https://api.github.com/repos/uber/ringpop-go/pulls/comments/91941605"},"html":{"href":"https://github.com/uber/ringpop-go/pull/188#discussion_r91941605"},"pull_request":{"href":"https://api.github.com/repos/uber/ringpop-go/pulls/188"}}},"pull_request":{"url":"https://api.github.com/repos/uber/ringpop-go/pulls/188","id":95553094,"html_url":"https://github.com/uber/ringpop-go/pull/188","diff_url":"https://github.com/uber/ringpop-go/pull/188.diff","patch_url":"https://github.com/uber/ringpop-go/pull/188.patch","issue_url":"https://api.github.com/repos/uber/ringpop-go/issues/188","number":188,"state":"open","locked":false,"title":"[Feature] Identity carry over part 1 / RBTree abstraction","user":{"login":"thanodnl","id":273145,"avatar_url":"https://avatars.githubusercontent.com/u/273145?v=3","gravatar_id":"","url":"https://api.github.com/users/thanodnl","html_url":"https://github.com/thanodnl","followers_url":"https://api.github.com/users/thanodnl/followers","following_url":"https://api.github.com/users/thanodnl/following{/other_user}","gists_url":"https://api.github.com/users/thanodnl/gists{/gist_id}","starred_url":"https://api.github.com/users/thanodnl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thanodnl/subscriptions","organizations_url":"https://api.github.com/users/thanodnl/orgs","repos_url":"https://api.github.com/users/thanodnl/repos","events_url":"https://api.github.com/users/thanodnl/events{/privacy}","received_events_url":"https://api.github.com/users/thanodnl/received_events","type":"User","site_admin":false},"body":"This is the first part of identity carry over where we abstract the RBTree to not care about the datatypes stored as long as the key is sortable via a Compare function it will create a RBTree.\r\n\r\nThis will help in later stages where the `keytype` will be a struct with more data points instead of a string.","created_at":"2016-11-28T18:35:07Z","updated_at":"2016-12-12T13:00:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dcec9eb80f092a628e87efe74e40f0a2a3810618","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/uber/ringpop-go/pulls/188/commits","review_comments_url":"https://api.github.com/repos/uber/ringpop-go/pulls/188/comments","review_comment_url":"https://api.github.com/repos/uber/ringpop-go/pulls/comments{/number}","comments_url":"https://api.github.com/repos/uber/ringpop-go/issues/188/comments","statuses_url":"https://api.github.com/repos/uber/ringpop-go/statuses/5e842dae9b379c936e42da276622d21f86fe0ded","head":{"label":"uber:feature/rbtree-absraction","ref":"feature/rbtree-absraction","sha":"5e842dae9b379c936e42da276622d21f86fe0ded","user":{"login":"uber","id":538264,"avatar_url":"https://avatars.githubusercontent.com/u/538264?v=3","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"repo":{"id":36959143,"name":"ringpop-go","full_name":"uber/ringpop-go","owner":{"login":"uber","id":538264,"avatar_url":"https://avatars.githubusercontent.com/u/538264?v=3","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uber/ringpop-go","description":"Scalable, fault-tolerant application-layer sharding for Go applications","fork":false,"url":"https://api.github.com/repos/uber/ringpop-go","forks_url":"https://api.github.com/repos/uber/ringpop-go/forks","keys_url":"https://api.github.com/repos/uber/ringpop-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uber/ringpop-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uber/ringpop-go/teams","hooks_url":"https://api.github.com/repos/uber/ringpop-go/hooks","issue_events_url":"https://api.github.com/repos/uber/ringpop-go/issues/events{/number}","events_url":"https://api.github.com/repos/uber/ringpop-go/events","assignees_url":"https://api.github.com/repos/uber/ringpop-go/assignees{/user}","branches_url":"https://api.github.com/repos/uber/ringpop-go/branches{/branch}","tags_url":"https://api.github.com/repos/uber/ringpop-go/tags","blobs_url":"https://api.github.com/repos/uber/ringpop-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uber/ringpop-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uber/ringpop-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/uber/ringpop-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uber/ringpop-go/statuses/{sha}","languages_url":"https://api.github.com/repos/uber/ringpop-go/languages","stargazers_url":"https://api.github.com/repos/uber/ringpop-go/stargazers","contributors_url":"https://api.github.com/repos/uber/ringpop-go/contributors","subscribers_url":"https://api.github.com/repos/uber/ringpop-go/subscribers","subscription_url":"https://api.github.com/repos/uber/ringpop-go/subscription","commits_url":"https://api.github.com/repos/uber/ringpop-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/uber/ringpop-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/uber/ringpop-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/uber/ringpop-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/uber/ringpop-go/contents/{+path}","compare_url":"https://api.github.com/repos/uber/ringpop-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uber/ringpop-go/merges","archive_url":"https://api.github.com/repos/uber/ringpop-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uber/ringpop-go/downloads","issues_url":"https://api.github.com/repos/uber/ringpop-go/issues{/number}","pulls_url":"https://api.github.com/repos/uber/ringpop-go/pulls{/number}","milestones_url":"https://api.github.com/repos/uber/ringpop-go/milestones{/number}","notifications_url":"https://api.github.com/repos/uber/ringpop-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uber/ringpop-go/labels{/name}","releases_url":"https://api.github.com/repos/uber/ringpop-go/releases{/id}","deployments_url":"https://api.github.com/repos/uber/ringpop-go/deployments","created_at":"2015-06-05T22:48:53Z","updated_at":"2016-12-12T07:19:29Z","pushed_at":"2016-12-09T22:46:28Z","git_url":"git://github.com/uber/ringpop-go.git","ssh_url":"git@github.com:uber/ringpop-go.git","clone_url":"https://github.com/uber/ringpop-go.git","svn_url":"https://github.com/uber/ringpop-go","homepage":"http://www.uber.com","size":6496,"stargazers_count":238,"watchers_count":238,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":20,"mirror_url":null,"open_issues_count":29,"forks":20,"open_issues":29,"watchers":238,"default_branch":"master"}},"base":{"label":"uber:dev","ref":"dev","sha":"cc3ae2ec02e22d78418d7515db444da1be5178f8","user":{"login":"uber","id":538264,"avatar_url":"https://avatars.githubusercontent.com/u/538264?v=3","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"repo":{"id":36959143,"name":"ringpop-go","full_name":"uber/ringpop-go","owner":{"login":"uber","id":538264,"avatar_url":"https://avatars.githubusercontent.com/u/538264?v=3","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uber/ringpop-go","description":"Scalable, fault-tolerant application-layer sharding for Go applications","fork":false,"url":"https://api.github.com/repos/uber/ringpop-go","forks_url":"https://api.github.com/repos/uber/ringpop-go/forks","keys_url":"https://api.github.com/repos/uber/ringpop-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uber/ringpop-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uber/ringpop-go/teams","hooks_url":"https://api.github.com/repos/uber/ringpop-go/hooks","issue_events_url":"https://api.github.com/repos/uber/ringpop-go/issues/events{/number}","events_url":"https://api.github.com/repos/uber/ringpop-go/events","assignees_url":"https://api.github.com/repos/uber/ringpop-go/assignees{/user}","branches_url":"https://api.github.com/repos/uber/ringpop-go/branches{/branch}","tags_url":"https://api.github.com/repos/uber/ringpop-go/tags","blobs_url":"https://api.github.com/repos/uber/ringpop-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uber/ringpop-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uber/ringpop-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/uber/ringpop-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uber/ringpop-go/statuses/{sha}","languages_url":"https://api.github.com/repos/uber/ringpop-go/languages","stargazers_url":"https://api.github.com/repos/uber/ringpop-go/stargazers","contributors_url":"https://api.github.com/repos/uber/ringpop-go/contributors","subscribers_url":"https://api.github.com/repos/uber/ringpop-go/subscribers","subscription_url":"https://api.github.com/repos/uber/ringpop-go/subscription","commits_url":"https://api.github.com/repos/uber/ringpop-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/uber/ringpop-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/uber/ringpop-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/uber/ringpop-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/uber/ringpop-go/contents/{+path}","compare_url":"https://api.github.com/repos/uber/ringpop-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uber/ringpop-go/merges","archive_url":"https://api.github.com/repos/uber/ringpop-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uber/ringpop-go/downloads","issues_url":"https://api.github.com/repos/uber/ringpop-go/issues{/number}","pulls_url":"https://api.github.com/repos/uber/ringpop-go/pulls{/number}","milestones_url":"https://api.github.com/repos/uber/ringpop-go/milestones{/number}","notifications_url":"https://api.github.com/repos/uber/ringpop-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uber/ringpop-go/labels{/name}","releases_url":"https://api.github.com/repos/uber/ringpop-go/releases{/id}","deployments_url":"https://api.github.com/repos/uber/ringpop-go/deployments","created_at":"2015-06-05T22:48:53Z","updated_at":"2016-12-12T07:19:29Z","pushed_at":"2016-12-09T22:46:28Z","git_url":"git://github.com/uber/ringpop-go.git","ssh_url":"git@github.com:uber/ringpop-go.git","clone_url":"https://github.com/uber/ringpop-go.git","svn_url":"https://github.com/uber/ringpop-go","homepage":"http://www.uber.com","size":6496,"stargazers_count":238,"watchers_count":238,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":20,"mirror_url":null,"open_issues_count":29,"forks":20,"open_issues":29,"watchers":238,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/uber/ringpop-go/pulls/188"},"html":{"href":"https://github.com/uber/ringpop-go/pull/188"},"issue":{"href":"https://api.github.com/repos/uber/ringpop-go/issues/188"},"comments":{"href":"https://api.github.com/repos/uber/ringpop-go/issues/188/comments"},"review_comments":{"href":"https://api.github.com/repos/uber/ringpop-go/pulls/188/comments"},"review_comment":{"href":"https://api.github.com/repos/uber/ringpop-go/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/uber/ringpop-go/pulls/188/commits"},"statuses":{"href":"https://api.github.com/repos/uber/ringpop-go/statuses/5e842dae9b379c936e42da276622d21f86fe0ded"}}}}
{"actor":{"display_login":"mennopruijssers"}}