{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/144778518","pull_request_review_id":69481086,"id":144778518,"diff_hunk":"@@ -68,3 +68,17 @@ func ContainsString(slice []string, s string, modifier func(s string) string) bo\n \t}\n \treturn false\n }\n+\n+// removeDuplicates remove the duplicate value in the slice and keep the order unchanged\n+func RemoveDuplicates(s []string) (ret []string) {\n+\tencountered := map[string]bool{}\n+\tfor i := range s {\n+\t\tif encountered[s[i]] {\n+\t\t\tcontinue\n+\t\t} else {\n+\t\t\tencountered[s[i]] = true\n+\t\t\tret = append(ret, s[i])","path":"pkg/util/slice/slice.go","position":13,"original_position":13,"commit_id":"ee40964ff37223a90653442967d4e632ec30434a","original_commit_id":"ee40964ff37223a90653442967d4e632ec30434a","user":{"login":"sttts","id":730123,"avatar_url":"https://avatars0.githubusercontent.com/u/730123?v=4","gravatar_id":"","url":"https://api.github.com/users/sttts","html_url":"https://github.com/sttts","followers_url":"https://api.github.com/users/sttts/followers","following_url":"https://api.github.com/users/sttts/following{/other_user}","gists_url":"https://api.github.com/users/sttts/gists{/gist_id}","starred_url":"https://api.github.com/users/sttts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sttts/subscriptions","organizations_url":"https://api.github.com/users/sttts/orgs","repos_url":"https://api.github.com/users/sttts/repos","events_url":"https://api.github.com/users/sttts/events{/privacy}","received_events_url":"https://api.github.com/users/sttts/received_events","type":"User","site_admin":false},"body":"can we pre-allocate ret?","created_at":"2017-10-16T08:08:49Z","updated_at":"2017-10-16T08:08:49Z","html_url":"https://github.com/kubernetes/kubernetes/pull/53880#discussion_r144778518","pull_request_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/53880","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/144778518"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/53880#discussion_r144778518"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/53880"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/53880","id":146400454,"html_url":"https://github.com/kubernetes/kubernetes/pull/53880","diff_url":"https://github.com/kubernetes/kubernetes/pull/53880.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/53880.patch","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/53880","number":53880,"state":"open","locked":false,"title":"prevent the same path load multiple times","user":{"login":"wackxu","id":30396467,"avatar_url":"https://avatars1.githubusercontent.com/u/30396467?v=4","gravatar_id":"","url":"https://api.github.com/users/wackxu","html_url":"https://github.com/wackxu","followers_url":"https://api.github.com/users/wackxu/followers","following_url":"https://api.github.com/users/wackxu/following{/other_user}","gists_url":"https://api.github.com/users/wackxu/gists{/gist_id}","starred_url":"https://api.github.com/users/wackxu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wackxu/subscriptions","organizations_url":"https://api.github.com/users/wackxu/orgs","repos_url":"https://api.github.com/users/wackxu/repos","events_url":"https://api.github.com/users/wackxu/events{/privacy}","received_events_url":"https://api.github.com/users/wackxu/received_events","type":"User","site_admin":false},"body":"\r\n\r\n<!--  Thanks for sending a pull request!  Here are some tips for you:\r\n1. If this is your first time, read our contributor guidelines https://git.k8s.io/community/contributors/devel/pull-requests.md#the-pr-submit-process and developer guide https://git.k8s.io/community/contributors/devel/development.md#development-guide\r\n2. If you want *faster* PR reviews, read how: https://git.k8s.io/community/contributors/devel/pull-requests.md#best-practices-for-faster-reviews\r\n3. Follow the instructions for writing a release note: https://git.k8s.io/community/contributors/devel/pull-requests.md#write-release-notes-if-needed\r\n-->\r\n\r\n**What this PR does / why we need it**:\r\n\r\nprevent the same path load multiple times，if there are several same path, we only load one time\r\n\r\n**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #53723\r\n\r\n**Special notes for your reviewer**:\r\n\r\n**Release note**:\r\n<!--  Steps to write your release note:\r\n1. Use the release-note-* labels to set the release note state (if you have access)\r\n2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`.\r\n-->\r\n```release-note\r\nNONE\r\n```\r\n","created_at":"2017-10-13T08:38:04Z","updated_at":"2017-10-16T08:08:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d906d1922c02e6121048651d62b9aec5cea90930","assignee":{"login":"sttts","id":730123,"avatar_url":"https://avatars0.githubusercontent.com/u/730123?v=4","gravatar_id":"","url":"https://api.github.com/users/sttts","html_url":"https://github.com/sttts","followers_url":"https://api.github.com/users/sttts/followers","following_url":"https://api.github.com/users/sttts/following{/other_user}","gists_url":"https://api.github.com/users/sttts/gists{/gist_id}","starred_url":"https://api.github.com/users/sttts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sttts/subscriptions","organizations_url":"https://api.github.com/users/sttts/orgs","repos_url":"https://api.github.com/users/sttts/repos","events_url":"https://api.github.com/users/sttts/events{/privacy}","received_events_url":"https://api.github.com/users/sttts/received_events","type":"User","site_admin":false},"assignees":[{"login":"sttts","id":730123,"avatar_url":"https://avatars0.githubusercontent.com/u/730123?v=4","gravatar_id":"","url":"https://api.github.com/users/sttts","html_url":"https://github.com/sttts","followers_url":"https://api.github.com/users/sttts/followers","following_url":"https://api.github.com/users/sttts/following{/other_user}","gists_url":"https://api.github.com/users/sttts/gists{/gist_id}","starred_url":"https://api.github.com/users/sttts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sttts/subscriptions","organizations_url":"https://api.github.com/users/sttts/orgs","repos_url":"https://api.github.com/users/sttts/repos","events_url":"https://api.github.com/users/sttts/events{/privacy}","received_events_url":"https://api.github.com/users/sttts/received_events","type":"User","site_admin":false},{"login":"roberthbailey","id":7751204,"avatar_url":"https://avatars1.githubusercontent.com/u/7751204?v=4","gravatar_id":"","url":"https://api.github.com/users/roberthbailey","html_url":"https://github.com/roberthbailey","followers_url":"https://api.github.com/users/roberthbailey/followers","following_url":"https://api.github.com/users/roberthbailey/following{/other_user}","gists_url":"https://api.github.com/users/roberthbailey/gists{/gist_id}","starred_url":"https://api.github.com/users/roberthbailey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roberthbailey/subscriptions","organizations_url":"https://api.github.com/users/roberthbailey/orgs","repos_url":"https://api.github.com/users/roberthbailey/repos","events_url":"https://api.github.com/users/roberthbailey/events{/privacy}","received_events_url":"https://api.github.com/users/roberthbailey/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/53880/commits","review_comments_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/53880/comments","review_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/53880/comments","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/ee40964ff37223a90653442967d4e632ec30434a","head":{"label":"wackxu:kubeconfig","ref":"kubeconfig","sha":"ee40964ff37223a90653442967d4e632ec30434a","user":{"login":"wackxu","id":30396467,"avatar_url":"https://avatars1.githubusercontent.com/u/30396467?v=4","gravatar_id":"","url":"https://api.github.com/users/wackxu","html_url":"https://github.com/wackxu","followers_url":"https://api.github.com/users/wackxu/followers","following_url":"https://api.github.com/users/wackxu/following{/other_user}","gists_url":"https://api.github.com/users/wackxu/gists{/gist_id}","starred_url":"https://api.github.com/users/wackxu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wackxu/subscriptions","organizations_url":"https://api.github.com/users/wackxu/orgs","repos_url":"https://api.github.com/users/wackxu/repos","events_url":"https://api.github.com/users/wackxu/events{/privacy}","received_events_url":"https://api.github.com/users/wackxu/received_events","type":"User","site_admin":false},"repo":{"id":98251349,"name":"kubernetes","full_name":"wackxu/kubernetes","owner":{"login":"wackxu","id":30396467,"avatar_url":"https://avatars1.githubusercontent.com/u/30396467?v=4","gravatar_id":"","url":"https://api.github.com/users/wackxu","html_url":"https://github.com/wackxu","followers_url":"https://api.github.com/users/wackxu/followers","following_url":"https://api.github.com/users/wackxu/following{/other_user}","gists_url":"https://api.github.com/users/wackxu/gists{/gist_id}","starred_url":"https://api.github.com/users/wackxu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wackxu/subscriptions","organizations_url":"https://api.github.com/users/wackxu/orgs","repos_url":"https://api.github.com/users/wackxu/repos","events_url":"https://api.github.com/users/wackxu/events{/privacy}","received_events_url":"https://api.github.com/users/wackxu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wackxu/kubernetes","description":"Production-Grade Container Scheduling and Management","fork":true,"url":"https://api.github.com/repos/wackxu/kubernetes","forks_url":"https://api.github.com/repos/wackxu/kubernetes/forks","keys_url":"https://api.github.com/repos/wackxu/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wackxu/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wackxu/kubernetes/teams","hooks_url":"https://api.github.com/repos/wackxu/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/wackxu/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/wackxu/kubernetes/events","assignees_url":"https://api.github.com/repos/wackxu/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/wackxu/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/wackxu/kubernetes/tags","blobs_url":"https://api.github.com/repos/wackxu/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wackxu/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wackxu/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/wackxu/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wackxu/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/wackxu/kubernetes/languages","stargazers_url":"https://api.github.com/repos/wackxu/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/wackxu/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/wackxu/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/wackxu/kubernetes/subscription","commits_url":"https://api.github.com/repos/wackxu/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/wackxu/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/wackxu/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/wackxu/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/wackxu/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/wackxu/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wackxu/kubernetes/merges","archive_url":"https://api.github.com/repos/wackxu/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wackxu/kubernetes/downloads","issues_url":"https://api.github.com/repos/wackxu/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/wackxu/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/wackxu/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/wackxu/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wackxu/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/wackxu/kubernetes/releases{/id}","deployments_url":"https://api.github.com/repos/wackxu/kubernetes/deployments","created_at":"2017-07-25T01:42:08Z","updated_at":"2017-07-25T01:42:48Z","pushed_at":"2017-10-14T12:51:23Z","git_url":"git://github.com/wackxu/kubernetes.git","ssh_url":"git@github.com:wackxu/kubernetes.git","clone_url":"https://github.com/wackxu/kubernetes.git","svn_url":"https://github.com/wackxu/kubernetes","homepage":"http://kubernetes.io","size":501361,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"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":"kubernetes:master","ref":"master","sha":"cc49b34d290b90a45177755092b126e331cfa86a","user":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars2.githubusercontent.com/u/13629408?v=4","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"repo":{"id":20580498,"name":"kubernetes","full_name":"kubernetes/kubernetes","owner":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars2.githubusercontent.com/u/13629408?v=4","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kubernetes/kubernetes","description":"Production-Grade Container Scheduling and Management","fork":false,"url":"https://api.github.com/repos/kubernetes/kubernetes","forks_url":"https://api.github.com/repos/kubernetes/kubernetes/forks","keys_url":"https://api.github.com/repos/kubernetes/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kubernetes/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kubernetes/kubernetes/teams","hooks_url":"https://api.github.com/repos/kubernetes/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/kubernetes/kubernetes/events","assignees_url":"https://api.github.com/repos/kubernetes/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/kubernetes/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/kubernetes/kubernetes/tags","blobs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kubernetes/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/kubernetes/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/kubernetes/kubernetes/languages","stargazers_url":"https://api.github.com/repos/kubernetes/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/kubernetes/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/kubernetes/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/kubernetes/kubernetes/subscription","commits_url":"https://api.github.com/repos/kubernetes/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/kubernetes/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/kubernetes/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/kubernetes/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kubernetes/kubernetes/merges","archive_url":"https://api.github.com/repos/kubernetes/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kubernetes/kubernetes/downloads","issues_url":"https://api.github.com/repos/kubernetes/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/kubernetes/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/kubernetes/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/kubernetes/kubernetes/releases{/id}","deployments_url":"https://api.github.com/repos/kubernetes/kubernetes/deployments","created_at":"2014-06-06T22:56:04Z","updated_at":"2017-10-16T07:55:58Z","pushed_at":"2017-10-16T07:38:15Z","git_url":"git://github.com/kubernetes/kubernetes.git","ssh_url":"git@github.com:kubernetes/kubernetes.git","clone_url":"https://github.com/kubernetes/kubernetes.git","svn_url":"https://github.com/kubernetes/kubernetes","homepage":"http://kubernetes.io","size":722020,"stargazers_count":27699,"watchers_count":27699,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9928,"mirror_url":null,"open_issues_count":5515,"forks":9928,"open_issues":5515,"watchers":27699,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/53880"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/53880"},"issue":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/53880"},"comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/53880/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/53880/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/53880/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/kubernetes/statuses/ee40964ff37223a90653442967d4e632ec30434a"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"sttts"}}