{"action":"created","issue":{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-netflix/issues/2470","repository_url":"https://api.github.com/repos/spring-cloud/spring-cloud-netflix","labels_url":"https://api.github.com/repos/spring-cloud/spring-cloud-netflix/issues/2470/labels{/name}","comments_url":"https://api.github.com/repos/spring-cloud/spring-cloud-netflix/issues/2470/comments","events_url":"https://api.github.com/repos/spring-cloud/spring-cloud-netflix/issues/2470/events","html_url":"https://github.com/spring-cloud/spring-cloud-netflix/pull/2470","id":276832442,"number":2470,"title":"Associated with this PR # 2466","user":{"login":"holy12345","id":29788052,"avatar_url":"https://avatars1.githubusercontent.com/u/29788052?v=4","gravatar_id":"","url":"https://api.github.com/users/holy12345","html_url":"https://github.com/holy12345","followers_url":"https://api.github.com/users/holy12345/followers","following_url":"https://api.github.com/users/holy12345/following{/other_user}","gists_url":"https://api.github.com/users/holy12345/gists{/gist_id}","starred_url":"https://api.github.com/users/holy12345/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/holy12345/subscriptions","organizations_url":"https://api.github.com/users/holy12345/orgs","repos_url":"https://api.github.com/users/holy12345/repos","events_url":"https://api.github.com/users/holy12345/events{/privacy}","received_events_url":"https://api.github.com/users/holy12345/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-11-26T15:23:59Z","updated_at":"2017-11-27T16:28:18Z","closed_at":"2017-11-27T12:55:40Z","author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-netflix/pulls/2470","html_url":"https://github.com/spring-cloud/spring-cloud-netflix/pull/2470","diff_url":"https://github.com/spring-cloud/spring-cloud-netflix/pull/2470.diff","patch_url":"https://github.com/spring-cloud/spring-cloud-netflix/pull/2470.patch"},"body":"I closed the pr # 2466 and recreated one.\r\nThe reason I submit this pr is as follows：\r\nMy understanding is that there is no difference between using the \"+\" concatenated string and StringBuilder (because the java compiler helped us to optimize it). However, if the two are very different within the loop. Using \"+\" inside the loop concatenates strings results in a new StringBuilder object being created each time, thus wasting unnecessary jvm memory。Use jad to see the compiled code.\r\nUse \"+\" to concatenate strings：\r\n\r\n```\r\nfor(int j = 0; j < i; j++)\r\n{\r\nString u = args1[j];\r\nif(u.contains(\"@\"))\r\nfilteredUrls = (new StringBuilder()).append(filteredUrls).append(u.substring(0, u.indexOf(\"//\") + 2)).append(u.substring(u.indexOf(\"@\") + 1, u.length())).append(\",\").toString();\r\nelse\r\nfilteredUrls = (new StringBuilder()).append(filteredUrls).append(u).append(\",\").toString();\r\n}\r\n```\r\n\r\nUse StringBuilder ：\r\n```\r\nfor(int j = 0; j < i; j++)\r\n{\r\nString u = args1[j];\r\nif(u.contains(\"@\"))\r\n{\r\nbuilder.append(u.substring(0, u.indexOf(\"//\") + 2)).append(u.substring(u.indexOf(\"@\") + 1, u.length())).append(\",\");\r\n} else\r\n{\r\nfilteredUrls = (new StringBuilder()).append(filteredUrls).append(u).append(\",\").toString();\r\nbuilder.append(u).append(\",\");\r\n}\r\n}\r\n```\r\n\r\nSo I submitted this PR, hoping to improve the performance of this part of the code ，hope you can pass this PR：）"},"comment":{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-netflix/issues/comments/347237447","html_url":"https://github.com/spring-cloud/spring-cloud-netflix/pull/2470#issuecomment-347237447","issue_url":"https://api.github.com/repos/spring-cloud/spring-cloud-netflix/issues/2470","id":347237447,"user":{"login":"ryanjbaxter","id":524254,"avatar_url":"https://avatars1.githubusercontent.com/u/524254?v=4","gravatar_id":"","url":"https://api.github.com/users/ryanjbaxter","html_url":"https://github.com/ryanjbaxter","followers_url":"https://api.github.com/users/ryanjbaxter/followers","following_url":"https://api.github.com/users/ryanjbaxter/following{/other_user}","gists_url":"https://api.github.com/users/ryanjbaxter/gists{/gist_id}","starred_url":"https://api.github.com/users/ryanjbaxter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryanjbaxter/subscriptions","organizations_url":"https://api.github.com/users/ryanjbaxter/orgs","repos_url":"https://api.github.com/users/ryanjbaxter/repos","events_url":"https://api.github.com/users/ryanjbaxter/events{/privacy}","received_events_url":"https://api.github.com/users/ryanjbaxter/received_events","type":"User","site_admin":false},"created_at":"2017-11-27T16:28:18Z","updated_at":"2017-11-27T16:28:18Z","author_association":"CONTRIBUTOR","body":"It will be in the next Edgware release"}}
{"actor":{"display_login":"ryanjbaxter"}}