{"action":"created","comment":{"url":"https://api.github.com/repos/sakura-editor/sakura/pulls/comments/201661237","pull_request_review_id":136204321,"id":201661237,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMTY2MTIzNw==","diff_hunk":"@@ -48,33 +51,36 @@ CTextInputStream::~CTextInputStream()\n {\n }\n \n-\n-wstring CTextInputStream::ReadLineW()\n+CNativeW& CTextInputStream::ReadLine()\n {\n-\t//$$ ������Ǎ��̂Ƃ���͋����āB�B\n-\tCNativeW line;\n-\tline.AllocStringBuffer(60);\n+\tm_mem._SetRawLength(0);\n+\tm_line._GetMemory()->_SetRawLength(0);\n \tfor (;;) {\n \t\tint c=getc(GetFp());\n \t\tif(c==EOF)break; //EOF�ŏI��\n \t\tif(c=='\\r'){ c=getc(GetFp()); if(c!='\\n')ungetc(c,GetFp()); break; } //\"\\r\" �܂��� \"\\r\\n\" �ŏI��\n \t\tif(c=='\\n')break; //\"\\n\" �ŏI��\n-\t\tif( line._GetMemory()->capacity() < line._GetMemory()->GetRawLength() + 10 ){\n-\t\t\tline._GetMemory()->AllocBuffer( line._GetMemory()->GetRawLength() * 2 );\n+\t\tif( m_mem.capacity() < m_mem.GetRawLength() + 10 ){\n+\t\t\tm_mem.AllocBuffer( m_mem.GetRawLength() * 2 );\n \t\t}\n-\t\tline._GetMemory()->AppendRawData(&c,sizeof(char));\n+\t\tm_mem.AppendRawData(&c,sizeof(char));\n \t}\n \n \t//UTF-8 �� UNICODE\n \tif(m_bIsUtf8){\n-\t\tCUtf8::UTF8ToUnicode(*(line._GetMemory()), &line);\n+\t\tCUtf8::UTF8ToUnicode(m_mem, &m_line);\n \t}\n \t//Shift_JIS �� UNICODE\n \telse{\n-\t\tCShiftJis::SJISToUnicode(*(line._GetMemory()), &line);\n+\t\tCShiftJis::SJISToUnicode(m_mem, &m_line);\n \t}\n+\treturn m_line;\n+}\n \n-\treturn wstring().assign( line.GetStringPtr(), line.GetStringLength() );\t// EOL �܂� NULL ������܂߂�\n+wstring CTextInputStream::ReadLineW()\n+{\n+\tReadLine();\n+\treturn wstring().assign( m_line.GetStringPtr(), m_line.GetStringLength() );\t// EOL �܂� NULL ������܂߂�","path":"sakura_core/io/CTextStream.cpp","position":null,"original_position":54,"commit_id":"063071dfa198f81f2cdfcbcde2cc96f032240fa8","original_commit_id":"063071dfa198f81f2cdfcbcde2cc96f032240fa8","user":{"login":"berryzplus","id":3253151,"node_id":"MDQ6VXNlcjMyNTMxNTE=","avatar_url":"https://avatars0.githubusercontent.com/u/3253151?v=4","gravatar_id":"","url":"https://api.github.com/users/berryzplus","html_url":"https://github.com/berryzplus","followers_url":"https://api.github.com/users/berryzplus/followers","following_url":"https://api.github.com/users/berryzplus/following{/other_user}","gists_url":"https://api.github.com/users/berryzplus/gists{/gist_id}","starred_url":"https://api.github.com/users/berryzplus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/berryzplus/subscriptions","organizations_url":"https://api.github.com/users/berryzplus/orgs","repos_url":"https://api.github.com/users/berryzplus/repos","events_url":"https://api.github.com/users/berryzplus/events{/privacy}","received_events_url":"https://api.github.com/users/berryzplus/received_events","type":"User","site_admin":false},"body":"雑談になっちゃうんですけど、効率を気にするならこういう書き方になると思います。\r\n```C++\r\n    return std::wstring( m_line.GetStringPtr(), m_line.GetStringLength() );\r\n```\r\n\r\n一度構築してから代入するのではなく、初めから目的の文字列をコンストラクタに渡せばよいです。\r\n\r\nあと、ReadLineメソッドにはそもそも戻り値を返さない場合（＝例外）があると思っています。このプロジェクト全般、例外を考慮した作りにはなっていないので、だからどうした、はないんですけど。","created_at":"2018-07-11T11:53:07Z","updated_at":"2018-07-11T11:53:07Z","html_url":"https://github.com/sakura-editor/sakura/pull/239#discussion_r201661237","pull_request_url":"https://api.github.com/repos/sakura-editor/sakura/pulls/239","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/sakura-editor/sakura/pulls/comments/201661237"},"html":{"href":"https://github.com/sakura-editor/sakura/pull/239#discussion_r201661237"},"pull_request":{"href":"https://api.github.com/repos/sakura-editor/sakura/pulls/239"}},"in_reply_to_id":201630979},"pull_request":{"url":"https://api.github.com/repos/sakura-editor/sakura/pulls/239","id":199958296,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk5OTU4Mjk2","html_url":"https://github.com/sakura-editor/sakura/pull/239","diff_url":"https://github.com/sakura-editor/sakura/pull/239.diff","patch_url":"https://github.com/sakura-editor/sakura/pull/239.patch","issue_url":"https://api.github.com/repos/sakura-editor/sakura/issues/239","number":239,"state":"open","locked":false,"title":"起動処理の高速化","user":{"login":"beru","id":1131125,"node_id":"MDQ6VXNlcjExMzExMjU=","avatar_url":"https://avatars1.githubusercontent.com/u/1131125?v=4","gravatar_id":"","url":"https://api.github.com/users/beru","html_url":"https://github.com/beru","followers_url":"https://api.github.com/users/beru/followers","following_url":"https://api.github.com/users/beru/following{/other_user}","gists_url":"https://api.github.com/users/beru/gists{/gist_id}","starred_url":"https://api.github.com/users/beru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beru/subscriptions","organizations_url":"https://api.github.com/users/beru/orgs","repos_url":"https://api.github.com/users/beru/repos","events_url":"https://api.github.com/users/beru/events{/privacy}","received_events_url":"https://api.github.com/users/beru/received_events","type":"User","site_admin":false},"body":"体感しづらいかもしれませんが起動処理を高速化しました。","created_at":"2018-07-08T20:11:24Z","updated_at":"2018-07-11T11:53:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"51b72e7dde09603a6cf439726f9da2c8340598bb","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/sakura-editor/sakura/pulls/239/commits","review_comments_url":"https://api.github.com/repos/sakura-editor/sakura/pulls/239/comments","review_comment_url":"https://api.github.com/repos/sakura-editor/sakura/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sakura-editor/sakura/issues/239/comments","statuses_url":"https://api.github.com/repos/sakura-editor/sakura/statuses/063071dfa198f81f2cdfcbcde2cc96f032240fa8","head":{"label":"beru:optimize_startup","ref":"optimize_startup","sha":"063071dfa198f81f2cdfcbcde2cc96f032240fa8","user":{"login":"beru","id":1131125,"node_id":"MDQ6VXNlcjExMzExMjU=","avatar_url":"https://avatars1.githubusercontent.com/u/1131125?v=4","gravatar_id":"","url":"https://api.github.com/users/beru","html_url":"https://github.com/beru","followers_url":"https://api.github.com/users/beru/followers","following_url":"https://api.github.com/users/beru/following{/other_user}","gists_url":"https://api.github.com/users/beru/gists{/gist_id}","starred_url":"https://api.github.com/users/beru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beru/subscriptions","organizations_url":"https://api.github.com/users/beru/orgs","repos_url":"https://api.github.com/users/beru/repos","events_url":"https://api.github.com/users/beru/events{/privacy}","received_events_url":"https://api.github.com/users/beru/received_events","type":"User","site_admin":false},"repo":{"id":136746507,"node_id":"MDEwOlJlcG9zaXRvcnkxMzY3NDY1MDc=","name":"sakura","full_name":"beru/sakura","owner":{"login":"beru","id":1131125,"node_id":"MDQ6VXNlcjExMzExMjU=","avatar_url":"https://avatars1.githubusercontent.com/u/1131125?v=4","gravatar_id":"","url":"https://api.github.com/users/beru","html_url":"https://github.com/beru","followers_url":"https://api.github.com/users/beru/followers","following_url":"https://api.github.com/users/beru/following{/other_user}","gists_url":"https://api.github.com/users/beru/gists{/gist_id}","starred_url":"https://api.github.com/users/beru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beru/subscriptions","organizations_url":"https://api.github.com/users/beru/orgs","repos_url":"https://api.github.com/users/beru/repos","events_url":"https://api.github.com/users/beru/events{/privacy}","received_events_url":"https://api.github.com/users/beru/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/beru/sakura","description":"SourceForgeから移行。VS2017ビルド確認済。","fork":true,"url":"https://api.github.com/repos/beru/sakura","forks_url":"https://api.github.com/repos/beru/sakura/forks","keys_url":"https://api.github.com/repos/beru/sakura/keys{/key_id}","collaborators_url":"https://api.github.com/repos/beru/sakura/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/beru/sakura/teams","hooks_url":"https://api.github.com/repos/beru/sakura/hooks","issue_events_url":"https://api.github.com/repos/beru/sakura/issues/events{/number}","events_url":"https://api.github.com/repos/beru/sakura/events","assignees_url":"https://api.github.com/repos/beru/sakura/assignees{/user}","branches_url":"https://api.github.com/repos/beru/sakura/branches{/branch}","tags_url":"https://api.github.com/repos/beru/sakura/tags","blobs_url":"https://api.github.com/repos/beru/sakura/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/beru/sakura/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/beru/sakura/git/refs{/sha}","trees_url":"https://api.github.com/repos/beru/sakura/git/trees{/sha}","statuses_url":"https://api.github.com/repos/beru/sakura/statuses/{sha}","languages_url":"https://api.github.com/repos/beru/sakura/languages","stargazers_url":"https://api.github.com/repos/beru/sakura/stargazers","contributors_url":"https://api.github.com/repos/beru/sakura/contributors","subscribers_url":"https://api.github.com/repos/beru/sakura/subscribers","subscription_url":"https://api.github.com/repos/beru/sakura/subscription","commits_url":"https://api.github.com/repos/beru/sakura/commits{/sha}","git_commits_url":"https://api.github.com/repos/beru/sakura/git/commits{/sha}","comments_url":"https://api.github.com/repos/beru/sakura/comments{/number}","issue_comment_url":"https://api.github.com/repos/beru/sakura/issues/comments{/number}","contents_url":"https://api.github.com/repos/beru/sakura/contents/{+path}","compare_url":"https://api.github.com/repos/beru/sakura/compare/{base}...{head}","merges_url":"https://api.github.com/repos/beru/sakura/merges","archive_url":"https://api.github.com/repos/beru/sakura/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/beru/sakura/downloads","issues_url":"https://api.github.com/repos/beru/sakura/issues{/number}","pulls_url":"https://api.github.com/repos/beru/sakura/pulls{/number}","milestones_url":"https://api.github.com/repos/beru/sakura/milestones{/number}","notifications_url":"https://api.github.com/repos/beru/sakura/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/beru/sakura/labels{/name}","releases_url":"https://api.github.com/repos/beru/sakura/releases{/id}","deployments_url":"https://api.github.com/repos/beru/sakura/deployments","created_at":"2018-06-09T18:03:32Z","updated_at":"2018-06-09T18:03:37Z","pushed_at":"2018-07-09T12:21:23Z","git_url":"git://github.com/beru/sakura.git","ssh_url":"git@github.com:beru/sakura.git","clone_url":"https://github.com/beru/sakura.git","svn_url":"https://github.com/beru/sakura","homepage":"","size":17081,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"sakura-editor:master","ref":"master","sha":"5da646982cda754f0b3f45810ebf43609afeb056","user":{"login":"sakura-editor","id":39432189,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM5NDMyMTg5","avatar_url":"https://avatars3.githubusercontent.com/u/39432189?v=4","gravatar_id":"","url":"https://api.github.com/users/sakura-editor","html_url":"https://github.com/sakura-editor","followers_url":"https://api.github.com/users/sakura-editor/followers","following_url":"https://api.github.com/users/sakura-editor/following{/other_user}","gists_url":"https://api.github.com/users/sakura-editor/gists{/gist_id}","starred_url":"https://api.github.com/users/sakura-editor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sakura-editor/subscriptions","organizations_url":"https://api.github.com/users/sakura-editor/orgs","repos_url":"https://api.github.com/users/sakura-editor/repos","events_url":"https://api.github.com/users/sakura-editor/events{/privacy}","received_events_url":"https://api.github.com/users/sakura-editor/received_events","type":"Organization","site_admin":false},"repo":{"id":134057969,"node_id":"MDEwOlJlcG9zaXRvcnkxMzQwNTc5Njk=","name":"sakura","full_name":"sakura-editor/sakura","owner":{"login":"sakura-editor","id":39432189,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM5NDMyMTg5","avatar_url":"https://avatars3.githubusercontent.com/u/39432189?v=4","gravatar_id":"","url":"https://api.github.com/users/sakura-editor","html_url":"https://github.com/sakura-editor","followers_url":"https://api.github.com/users/sakura-editor/followers","following_url":"https://api.github.com/users/sakura-editor/following{/other_user}","gists_url":"https://api.github.com/users/sakura-editor/gists{/gist_id}","starred_url":"https://api.github.com/users/sakura-editor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sakura-editor/subscriptions","organizations_url":"https://api.github.com/users/sakura-editor/orgs","repos_url":"https://api.github.com/users/sakura-editor/repos","events_url":"https://api.github.com/users/sakura-editor/events{/privacy}","received_events_url":"https://api.github.com/users/sakura-editor/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sakura-editor/sakura","description":"SourceForgeから移行。VS2017ビルド確認済。","fork":false,"url":"https://api.github.com/repos/sakura-editor/sakura","forks_url":"https://api.github.com/repos/sakura-editor/sakura/forks","keys_url":"https://api.github.com/repos/sakura-editor/sakura/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sakura-editor/sakura/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sakura-editor/sakura/teams","hooks_url":"https://api.github.com/repos/sakura-editor/sakura/hooks","issue_events_url":"https://api.github.com/repos/sakura-editor/sakura/issues/events{/number}","events_url":"https://api.github.com/repos/sakura-editor/sakura/events","assignees_url":"https://api.github.com/repos/sakura-editor/sakura/assignees{/user}","branches_url":"https://api.github.com/repos/sakura-editor/sakura/branches{/branch}","tags_url":"https://api.github.com/repos/sakura-editor/sakura/tags","blobs_url":"https://api.github.com/repos/sakura-editor/sakura/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sakura-editor/sakura/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sakura-editor/sakura/git/refs{/sha}","trees_url":"https://api.github.com/repos/sakura-editor/sakura/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sakura-editor/sakura/statuses/{sha}","languages_url":"https://api.github.com/repos/sakura-editor/sakura/languages","stargazers_url":"https://api.github.com/repos/sakura-editor/sakura/stargazers","contributors_url":"https://api.github.com/repos/sakura-editor/sakura/contributors","subscribers_url":"https://api.github.com/repos/sakura-editor/sakura/subscribers","subscription_url":"https://api.github.com/repos/sakura-editor/sakura/subscription","commits_url":"https://api.github.com/repos/sakura-editor/sakura/commits{/sha}","git_commits_url":"https://api.github.com/repos/sakura-editor/sakura/git/commits{/sha}","comments_url":"https://api.github.com/repos/sakura-editor/sakura/comments{/number}","issue_comment_url":"https://api.github.com/repos/sakura-editor/sakura/issues/comments{/number}","contents_url":"https://api.github.com/repos/sakura-editor/sakura/contents/{+path}","compare_url":"https://api.github.com/repos/sakura-editor/sakura/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sakura-editor/sakura/merges","archive_url":"https://api.github.com/repos/sakura-editor/sakura/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sakura-editor/sakura/downloads","issues_url":"https://api.github.com/repos/sakura-editor/sakura/issues{/number}","pulls_url":"https://api.github.com/repos/sakura-editor/sakura/pulls{/number}","milestones_url":"https://api.github.com/repos/sakura-editor/sakura/milestones{/number}","notifications_url":"https://api.github.com/repos/sakura-editor/sakura/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sakura-editor/sakura/labels{/name}","releases_url":"https://api.github.com/repos/sakura-editor/sakura/releases{/id}","deployments_url":"https://api.github.com/repos/sakura-editor/sakura/deployments","created_at":"2018-05-19T12:02:06Z","updated_at":"2018-07-11T09:40:46Z","pushed_at":"2018-07-11T08:19:09Z","git_url":"git://github.com/sakura-editor/sakura.git","ssh_url":"git@github.com:sakura-editor/sakura.git","clone_url":"https://github.com/sakura-editor/sakura.git","svn_url":"https://github.com/sakura-editor/sakura","homepage":"","size":17111,"stargazers_count":178,"watchers_count":178,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"archived":false,"open_issues_count":57,"license":null,"forks":11,"open_issues":57,"watchers":178,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sakura-editor/sakura/pulls/239"},"html":{"href":"https://github.com/sakura-editor/sakura/pull/239"},"issue":{"href":"https://api.github.com/repos/sakura-editor/sakura/issues/239"},"comments":{"href":"https://api.github.com/repos/sakura-editor/sakura/issues/239/comments"},"review_comments":{"href":"https://api.github.com/repos/sakura-editor/sakura/pulls/239/comments"},"review_comment":{"href":"https://api.github.com/repos/sakura-editor/sakura/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sakura-editor/sakura/pulls/239/commits"},"statuses":{"href":"https://api.github.com/repos/sakura-editor/sakura/statuses/063071dfa198f81f2cdfcbcde2cc96f032240fa8"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"berryzplus"}}