{"action":"opened","number":2,"pull_request":{"url":"https://api.github.com/repos/jteeuwen/spirv/pulls/2","id":30830116,"html_url":"https://github.com/jteeuwen/spirv/pull/2","diff_url":"https://github.com/jteeuwen/spirv/pull/2.diff","patch_url":"https://github.com/jteeuwen/spirv/pull/2.patch","issue_url":"https://api.github.com/repos/jteeuwen/spirv/issues/2","number":2,"state":"open","locked":false,"title":"Simplified EncodeString()","user":{"login":"komiga","id":63168,"avatar_url":"https://avatars.githubusercontent.com/u/63168?v=3","gravatar_id":"","url":"https://api.github.com/users/komiga","html_url":"https://github.com/komiga","followers_url":"https://api.github.com/users/komiga/followers","following_url":"https://api.github.com/users/komiga/following{/other_user}","gists_url":"https://api.github.com/users/komiga/gists{/gist_id}","starred_url":"https://api.github.com/users/komiga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/komiga/subscriptions","organizations_url":"https://api.github.com/users/komiga/orgs","repos_url":"https://api.github.com/users/komiga/repos","events_url":"https://api.github.com/users/komiga/events{/privacy}","received_events_url":"https://api.github.com/users/komiga/received_events","type":"User","site_admin":false},"body":"Special logic for the nul-terminator is unnecessary. `len(v) <= 3` always holds true for the tail block because the previous loop is writing whole blocks.\r\n\r\nSince a SPIR-V string literal retains character order (we'd be right to throw ourselves into a volcano otherwise), this function could also be faster by memcpy()ing the whole blocks instead of manually assigning them. I don't know Go well yet, so I haven't looked into doing it. I suspect we don't have non-copying access to `string` bytes. In this light, the repeated slicing in the whole block loop is suspicious.","created_at":"2015-03-10T08:19:16Z","updated_at":"2015-03-10T08:19:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jteeuwen/spirv/pulls/2/commits","review_comments_url":"https://api.github.com/repos/jteeuwen/spirv/pulls/2/comments","review_comment_url":"https://api.github.com/repos/jteeuwen/spirv/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jteeuwen/spirv/issues/2/comments","statuses_url":"https://api.github.com/repos/jteeuwen/spirv/statuses/7133a1588e28b024293c471cbfbe62c05f1fa9c7","head":{"label":"komiga:simplify-string-encoding","ref":"simplify-string-encoding","sha":"7133a1588e28b024293c471cbfbe62c05f1fa9c7","user":{"login":"komiga","id":63168,"avatar_url":"https://avatars.githubusercontent.com/u/63168?v=3","gravatar_id":"","url":"https://api.github.com/users/komiga","html_url":"https://github.com/komiga","followers_url":"https://api.github.com/users/komiga/followers","following_url":"https://api.github.com/users/komiga/following{/other_user}","gists_url":"https://api.github.com/users/komiga/gists{/gist_id}","starred_url":"https://api.github.com/users/komiga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/komiga/subscriptions","organizations_url":"https://api.github.com/users/komiga/orgs","repos_url":"https://api.github.com/users/komiga/repos","events_url":"https://api.github.com/users/komiga/events{/privacy}","received_events_url":"https://api.github.com/users/komiga/received_events","type":"User","site_admin":false},"repo":{"id":31938018,"name":"spirv","full_name":"komiga/spirv","owner":{"login":"komiga","id":63168,"avatar_url":"https://avatars.githubusercontent.com/u/63168?v=3","gravatar_id":"","url":"https://api.github.com/users/komiga","html_url":"https://github.com/komiga","followers_url":"https://api.github.com/users/komiga/followers","following_url":"https://api.github.com/users/komiga/following{/other_user}","gists_url":"https://api.github.com/users/komiga/gists{/gist_id}","starred_url":"https://api.github.com/users/komiga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/komiga/subscriptions","organizations_url":"https://api.github.com/users/komiga/orgs","repos_url":"https://api.github.com/users/komiga/repos","events_url":"https://api.github.com/users/komiga/events{/privacy}","received_events_url":"https://api.github.com/users/komiga/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/komiga/spirv","description":"Go encoder/decoder for the Khronos SPIR-V binary format.","fork":true,"url":"https://api.github.com/repos/komiga/spirv","forks_url":"https://api.github.com/repos/komiga/spirv/forks","keys_url":"https://api.github.com/repos/komiga/spirv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/komiga/spirv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/komiga/spirv/teams","hooks_url":"https://api.github.com/repos/komiga/spirv/hooks","issue_events_url":"https://api.github.com/repos/komiga/spirv/issues/events{/number}","events_url":"https://api.github.com/repos/komiga/spirv/events","assignees_url":"https://api.github.com/repos/komiga/spirv/assignees{/user}","branches_url":"https://api.github.com/repos/komiga/spirv/branches{/branch}","tags_url":"https://api.github.com/repos/komiga/spirv/tags","blobs_url":"https://api.github.com/repos/komiga/spirv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/komiga/spirv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/komiga/spirv/git/refs{/sha}","trees_url":"https://api.github.com/repos/komiga/spirv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/komiga/spirv/statuses/{sha}","languages_url":"https://api.github.com/repos/komiga/spirv/languages","stargazers_url":"https://api.github.com/repos/komiga/spirv/stargazers","contributors_url":"https://api.github.com/repos/komiga/spirv/contributors","subscribers_url":"https://api.github.com/repos/komiga/spirv/subscribers","subscription_url":"https://api.github.com/repos/komiga/spirv/subscription","commits_url":"https://api.github.com/repos/komiga/spirv/commits{/sha}","git_commits_url":"https://api.github.com/repos/komiga/spirv/git/commits{/sha}","comments_url":"https://api.github.com/repos/komiga/spirv/comments{/number}","issue_comment_url":"https://api.github.com/repos/komiga/spirv/issues/comments{/number}","contents_url":"https://api.github.com/repos/komiga/spirv/contents/{+path}","compare_url":"https://api.github.com/repos/komiga/spirv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/komiga/spirv/merges","archive_url":"https://api.github.com/repos/komiga/spirv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/komiga/spirv/downloads","issues_url":"https://api.github.com/repos/komiga/spirv/issues{/number}","pulls_url":"https://api.github.com/repos/komiga/spirv/pulls{/number}","milestones_url":"https://api.github.com/repos/komiga/spirv/milestones{/number}","notifications_url":"https://api.github.com/repos/komiga/spirv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/komiga/spirv/labels{/name}","releases_url":"https://api.github.com/repos/komiga/spirv/releases{/id}","created_at":"2015-03-10T04:16:10Z","updated_at":"2015-03-10T06:38:39Z","pushed_at":"2015-03-10T07:54:58Z","git_url":"git://github.com/komiga/spirv.git","ssh_url":"git@github.com:komiga/spirv.git","clone_url":"https://github.com/komiga/spirv.git","svn_url":"https://github.com/komiga/spirv","homepage":"","size":0,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"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":"jteeuwen:master","ref":"master","sha":"ea9e92619993bb1437a4daecff2f3cd17d74b731","user":{"login":"jteeuwen","id":98034,"avatar_url":"https://avatars.githubusercontent.com/u/98034?v=3","gravatar_id":"","url":"https://api.github.com/users/jteeuwen","html_url":"https://github.com/jteeuwen","followers_url":"https://api.github.com/users/jteeuwen/followers","following_url":"https://api.github.com/users/jteeuwen/following{/other_user}","gists_url":"https://api.github.com/users/jteeuwen/gists{/gist_id}","starred_url":"https://api.github.com/users/jteeuwen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jteeuwen/subscriptions","organizations_url":"https://api.github.com/users/jteeuwen/orgs","repos_url":"https://api.github.com/users/jteeuwen/repos","events_url":"https://api.github.com/users/jteeuwen/events{/privacy}","received_events_url":"https://api.github.com/users/jteeuwen/received_events","type":"User","site_admin":false},"repo":{"id":31926161,"name":"spirv","full_name":"jteeuwen/spirv","owner":{"login":"jteeuwen","id":98034,"avatar_url":"https://avatars.githubusercontent.com/u/98034?v=3","gravatar_id":"","url":"https://api.github.com/users/jteeuwen","html_url":"https://github.com/jteeuwen","followers_url":"https://api.github.com/users/jteeuwen/followers","following_url":"https://api.github.com/users/jteeuwen/following{/other_user}","gists_url":"https://api.github.com/users/jteeuwen/gists{/gist_id}","starred_url":"https://api.github.com/users/jteeuwen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jteeuwen/subscriptions","organizations_url":"https://api.github.com/users/jteeuwen/orgs","repos_url":"https://api.github.com/users/jteeuwen/repos","events_url":"https://api.github.com/users/jteeuwen/events{/privacy}","received_events_url":"https://api.github.com/users/jteeuwen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jteeuwen/spirv","description":"Go encoder/decoder for the Khronos SPIR-V binary format.","fork":false,"url":"https://api.github.com/repos/jteeuwen/spirv","forks_url":"https://api.github.com/repos/jteeuwen/spirv/forks","keys_url":"https://api.github.com/repos/jteeuwen/spirv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jteeuwen/spirv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jteeuwen/spirv/teams","hooks_url":"https://api.github.com/repos/jteeuwen/spirv/hooks","issue_events_url":"https://api.github.com/repos/jteeuwen/spirv/issues/events{/number}","events_url":"https://api.github.com/repos/jteeuwen/spirv/events","assignees_url":"https://api.github.com/repos/jteeuwen/spirv/assignees{/user}","branches_url":"https://api.github.com/repos/jteeuwen/spirv/branches{/branch}","tags_url":"https://api.github.com/repos/jteeuwen/spirv/tags","blobs_url":"https://api.github.com/repos/jteeuwen/spirv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jteeuwen/spirv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jteeuwen/spirv/git/refs{/sha}","trees_url":"https://api.github.com/repos/jteeuwen/spirv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jteeuwen/spirv/statuses/{sha}","languages_url":"https://api.github.com/repos/jteeuwen/spirv/languages","stargazers_url":"https://api.github.com/repos/jteeuwen/spirv/stargazers","contributors_url":"https://api.github.com/repos/jteeuwen/spirv/contributors","subscribers_url":"https://api.github.com/repos/jteeuwen/spirv/subscribers","subscription_url":"https://api.github.com/repos/jteeuwen/spirv/subscription","commits_url":"https://api.github.com/repos/jteeuwen/spirv/commits{/sha}","git_commits_url":"https://api.github.com/repos/jteeuwen/spirv/git/commits{/sha}","comments_url":"https://api.github.com/repos/jteeuwen/spirv/comments{/number}","issue_comment_url":"https://api.github.com/repos/jteeuwen/spirv/issues/comments{/number}","contents_url":"https://api.github.com/repos/jteeuwen/spirv/contents/{+path}","compare_url":"https://api.github.com/repos/jteeuwen/spirv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jteeuwen/spirv/merges","archive_url":"https://api.github.com/repos/jteeuwen/spirv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jteeuwen/spirv/downloads","issues_url":"https://api.github.com/repos/jteeuwen/spirv/issues{/number}","pulls_url":"https://api.github.com/repos/jteeuwen/spirv/pulls{/number}","milestones_url":"https://api.github.com/repos/jteeuwen/spirv/milestones{/number}","notifications_url":"https://api.github.com/repos/jteeuwen/spirv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jteeuwen/spirv/labels{/name}","releases_url":"https://api.github.com/repos/jteeuwen/spirv/releases{/id}","created_at":"2015-03-09T22:29:42Z","updated_at":"2015-03-10T06:17:24Z","pushed_at":"2015-03-09T23:36:45Z","git_url":"git://github.com/jteeuwen/spirv.git","ssh_url":"git@github.com:jteeuwen/spirv.git","clone_url":"https://github.com/jteeuwen/spirv.git","svn_url":"https://github.com/jteeuwen/spirv","homepage":"","size":0,"stargazers_count":1,"watchers_count":1,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jteeuwen/spirv/pulls/2"},"html":{"href":"https://github.com/jteeuwen/spirv/pull/2"},"issue":{"href":"https://api.github.com/repos/jteeuwen/spirv/issues/2"},"comments":{"href":"https://api.github.com/repos/jteeuwen/spirv/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/jteeuwen/spirv/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/jteeuwen/spirv/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jteeuwen/spirv/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/jteeuwen/spirv/statuses/7133a1588e28b024293c471cbfbe62c05f1fa9c7"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":16,"deletions":30,"changed_files":1}}