{"action":"created","comment":{"url":"https://api.github.com/repos/mruby/mruby/pulls/comments/37611761","id":37611761,"diff_hunk":"@@ -165,20 +157,16 @@ def each_byte(&block)\n   # Modify +self+ by replacing the content of +self+\n   # at the position +pos+ with +value+.\n   def []=(pos, value)\n-    if pos < 0\n-      pos += self.length\n-    end\n+    pos += self.length if pos < 0\n     b = self[0, pos]\n-    a = self[pos+1..-1]\n+    a = self[pos + 1..-1]","path":"mrblib/string.rb","position":40,"original_position":40,"commit_id":"85f0dd7da0fe41310883d9a65156c429135590f5","original_commit_id":"85f0dd7da0fe41310883d9a65156c429135590f5","user":{"login":"tsahara","id":388775,"avatar_url":"https://avatars.githubusercontent.com/u/388775?v=3","gravatar_id":"","url":"https://api.github.com/users/tsahara","html_url":"https://github.com/tsahara","followers_url":"https://api.github.com/users/tsahara/followers","following_url":"https://api.github.com/users/tsahara/following{/other_user}","gists_url":"https://api.github.com/users/tsahara/gists{/gist_id}","starred_url":"https://api.github.com/users/tsahara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tsahara/subscriptions","organizations_url":"https://api.github.com/users/tsahara/orgs","repos_url":"https://api.github.com/users/tsahara/repos","events_url":"https://api.github.com/users/tsahara/events{/privacy}","received_events_url":"https://api.github.com/users/tsahara/received_events","type":"User","site_admin":false},"body":"It looks more confusing.  I prefer `[pos+1 .. -1]`.","created_at":"2015-08-21T07:25:23Z","updated_at":"2015-08-21T07:25:23Z","html_url":"https://github.com/mruby/mruby/pull/2922#discussion_r37611761","pull_request_url":"https://api.github.com/repos/mruby/mruby/pulls/2922","_links":{"self":{"href":"https://api.github.com/repos/mruby/mruby/pulls/comments/37611761"},"html":{"href":"https://github.com/mruby/mruby/pull/2922#discussion_r37611761"},"pull_request":{"href":"https://api.github.com/repos/mruby/mruby/pulls/2922"}}},"pull_request":{"url":"https://api.github.com/repos/mruby/mruby/pulls/2922","id":43006688,"html_url":"https://github.com/mruby/mruby/pull/2922","diff_url":"https://github.com/mruby/mruby/pull/2922.diff","patch_url":"https://github.com/mruby/mruby/pull/2922.patch","issue_url":"https://api.github.com/repos/mruby/mruby/issues/2922","number":2922,"state":"open","locked":false,"title":"Refactor mrubygem code (range.rb, numeric.rb, string.rb, array.rb, enum.rb)","user":{"login":"gkta","id":13093040,"avatar_url":"https://avatars.githubusercontent.com/u/13093040?v=3","gravatar_id":"","url":"https://api.github.com/users/gkta","html_url":"https://github.com/gkta","followers_url":"https://api.github.com/users/gkta/followers","following_url":"https://api.github.com/users/gkta/following{/other_user}","gists_url":"https://api.github.com/users/gkta/gists{/gist_id}","starred_url":"https://api.github.com/users/gkta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gkta/subscriptions","organizations_url":"https://api.github.com/users/gkta/orgs","repos_url":"https://api.github.com/users/gkta/repos","events_url":"https://api.github.com/users/gkta/events{/privacy}","received_events_url":"https://api.github.com/users/gkta/received_events","type":"User","site_admin":false},"body":"* Avoid using {...} for multi-line blocks\r\n* Remove redundant code\r\n* Add space in default value assignment","created_at":"2015-08-21T06:03:28Z","updated_at":"2015-08-21T07:25:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e65e3be8934f7e56fd4c13e29df23260ee41a64f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mruby/mruby/pulls/2922/commits","review_comments_url":"https://api.github.com/repos/mruby/mruby/pulls/2922/comments","review_comment_url":"https://api.github.com/repos/mruby/mruby/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mruby/mruby/issues/2922/comments","statuses_url":"https://api.github.com/repos/mruby/mruby/statuses/85f0dd7da0fe41310883d9a65156c429135590f5","head":{"label":"gkta:refactor-mrubygem-code","ref":"refactor-mrubygem-code","sha":"85f0dd7da0fe41310883d9a65156c429135590f5","user":{"login":"gkta","id":13093040,"avatar_url":"https://avatars.githubusercontent.com/u/13093040?v=3","gravatar_id":"","url":"https://api.github.com/users/gkta","html_url":"https://github.com/gkta","followers_url":"https://api.github.com/users/gkta/followers","following_url":"https://api.github.com/users/gkta/following{/other_user}","gists_url":"https://api.github.com/users/gkta/gists{/gist_id}","starred_url":"https://api.github.com/users/gkta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gkta/subscriptions","organizations_url":"https://api.github.com/users/gkta/orgs","repos_url":"https://api.github.com/users/gkta/repos","events_url":"https://api.github.com/users/gkta/events{/privacy}","received_events_url":"https://api.github.com/users/gkta/received_events","type":"User","site_admin":false},"repo":{"id":40531958,"name":"mruby","full_name":"gkta/mruby","owner":{"login":"gkta","id":13093040,"avatar_url":"https://avatars.githubusercontent.com/u/13093040?v=3","gravatar_id":"","url":"https://api.github.com/users/gkta","html_url":"https://github.com/gkta","followers_url":"https://api.github.com/users/gkta/followers","following_url":"https://api.github.com/users/gkta/following{/other_user}","gists_url":"https://api.github.com/users/gkta/gists{/gist_id}","starred_url":"https://api.github.com/users/gkta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gkta/subscriptions","organizations_url":"https://api.github.com/users/gkta/orgs","repos_url":"https://api.github.com/users/gkta/repos","events_url":"https://api.github.com/users/gkta/events{/privacy}","received_events_url":"https://api.github.com/users/gkta/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gkta/mruby","description":"Lightweight Ruby","fork":true,"url":"https://api.github.com/repos/gkta/mruby","forks_url":"https://api.github.com/repos/gkta/mruby/forks","keys_url":"https://api.github.com/repos/gkta/mruby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gkta/mruby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gkta/mruby/teams","hooks_url":"https://api.github.com/repos/gkta/mruby/hooks","issue_events_url":"https://api.github.com/repos/gkta/mruby/issues/events{/number}","events_url":"https://api.github.com/repos/gkta/mruby/events","assignees_url":"https://api.github.com/repos/gkta/mruby/assignees{/user}","branches_url":"https://api.github.com/repos/gkta/mruby/branches{/branch}","tags_url":"https://api.github.com/repos/gkta/mruby/tags","blobs_url":"https://api.github.com/repos/gkta/mruby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gkta/mruby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gkta/mruby/git/refs{/sha}","trees_url":"https://api.github.com/repos/gkta/mruby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gkta/mruby/statuses/{sha}","languages_url":"https://api.github.com/repos/gkta/mruby/languages","stargazers_url":"https://api.github.com/repos/gkta/mruby/stargazers","contributors_url":"https://api.github.com/repos/gkta/mruby/contributors","subscribers_url":"https://api.github.com/repos/gkta/mruby/subscribers","subscription_url":"https://api.github.com/repos/gkta/mruby/subscription","commits_url":"https://api.github.com/repos/gkta/mruby/commits{/sha}","git_commits_url":"https://api.github.com/repos/gkta/mruby/git/commits{/sha}","comments_url":"https://api.github.com/repos/gkta/mruby/comments{/number}","issue_comment_url":"https://api.github.com/repos/gkta/mruby/issues/comments{/number}","contents_url":"https://api.github.com/repos/gkta/mruby/contents/{+path}","compare_url":"https://api.github.com/repos/gkta/mruby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gkta/mruby/merges","archive_url":"https://api.github.com/repos/gkta/mruby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gkta/mruby/downloads","issues_url":"https://api.github.com/repos/gkta/mruby/issues{/number}","pulls_url":"https://api.github.com/repos/gkta/mruby/pulls{/number}","milestones_url":"https://api.github.com/repos/gkta/mruby/milestones{/number}","notifications_url":"https://api.github.com/repos/gkta/mruby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gkta/mruby/labels{/name}","releases_url":"https://api.github.com/repos/gkta/mruby/releases{/id}","created_at":"2015-08-11T08:59:17Z","updated_at":"2015-08-11T08:59:18Z","pushed_at":"2015-08-21T05:59:11Z","git_url":"git://github.com/gkta/mruby.git","ssh_url":"git@github.com:gkta/mruby.git","clone_url":"https://github.com/gkta/mruby.git","svn_url":"https://github.com/gkta/mruby","homepage":null,"size":9526,"stargazers_count":0,"watchers_count":0,"language":"C","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":"mruby:master","ref":"master","sha":"71f2975a5ba93197fac6a08f21d84bc87e31c6ae","user":{"login":"mruby","id":1796512,"avatar_url":"https://avatars.githubusercontent.com/u/1796512?v=3","gravatar_id":"","url":"https://api.github.com/users/mruby","html_url":"https://github.com/mruby","followers_url":"https://api.github.com/users/mruby/followers","following_url":"https://api.github.com/users/mruby/following{/other_user}","gists_url":"https://api.github.com/users/mruby/gists{/gist_id}","starred_url":"https://api.github.com/users/mruby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mruby/subscriptions","organizations_url":"https://api.github.com/users/mruby/orgs","repos_url":"https://api.github.com/users/mruby/repos","events_url":"https://api.github.com/users/mruby/events{/privacy}","received_events_url":"https://api.github.com/users/mruby/received_events","type":"Organization","site_admin":false},"repo":{"id":4073516,"name":"mruby","full_name":"mruby/mruby","owner":{"login":"mruby","id":1796512,"avatar_url":"https://avatars.githubusercontent.com/u/1796512?v=3","gravatar_id":"","url":"https://api.github.com/users/mruby","html_url":"https://github.com/mruby","followers_url":"https://api.github.com/users/mruby/followers","following_url":"https://api.github.com/users/mruby/following{/other_user}","gists_url":"https://api.github.com/users/mruby/gists{/gist_id}","starred_url":"https://api.github.com/users/mruby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mruby/subscriptions","organizations_url":"https://api.github.com/users/mruby/orgs","repos_url":"https://api.github.com/users/mruby/repos","events_url":"https://api.github.com/users/mruby/events{/privacy}","received_events_url":"https://api.github.com/users/mruby/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mruby/mruby","description":"Lightweight Ruby","fork":false,"url":"https://api.github.com/repos/mruby/mruby","forks_url":"https://api.github.com/repos/mruby/mruby/forks","keys_url":"https://api.github.com/repos/mruby/mruby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mruby/mruby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mruby/mruby/teams","hooks_url":"https://api.github.com/repos/mruby/mruby/hooks","issue_events_url":"https://api.github.com/repos/mruby/mruby/issues/events{/number}","events_url":"https://api.github.com/repos/mruby/mruby/events","assignees_url":"https://api.github.com/repos/mruby/mruby/assignees{/user}","branches_url":"https://api.github.com/repos/mruby/mruby/branches{/branch}","tags_url":"https://api.github.com/repos/mruby/mruby/tags","blobs_url":"https://api.github.com/repos/mruby/mruby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mruby/mruby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mruby/mruby/git/refs{/sha}","trees_url":"https://api.github.com/repos/mruby/mruby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mruby/mruby/statuses/{sha}","languages_url":"https://api.github.com/repos/mruby/mruby/languages","stargazers_url":"https://api.github.com/repos/mruby/mruby/stargazers","contributors_url":"https://api.github.com/repos/mruby/mruby/contributors","subscribers_url":"https://api.github.com/repos/mruby/mruby/subscribers","subscription_url":"https://api.github.com/repos/mruby/mruby/subscription","commits_url":"https://api.github.com/repos/mruby/mruby/commits{/sha}","git_commits_url":"https://api.github.com/repos/mruby/mruby/git/commits{/sha}","comments_url":"https://api.github.com/repos/mruby/mruby/comments{/number}","issue_comment_url":"https://api.github.com/repos/mruby/mruby/issues/comments{/number}","contents_url":"https://api.github.com/repos/mruby/mruby/contents/{+path}","compare_url":"https://api.github.com/repos/mruby/mruby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mruby/mruby/merges","archive_url":"https://api.github.com/repos/mruby/mruby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mruby/mruby/downloads","issues_url":"https://api.github.com/repos/mruby/mruby/issues{/number}","pulls_url":"https://api.github.com/repos/mruby/mruby/pulls{/number}","milestones_url":"https://api.github.com/repos/mruby/mruby/milestones{/number}","notifications_url":"https://api.github.com/repos/mruby/mruby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mruby/mruby/labels{/name}","releases_url":"https://api.github.com/repos/mruby/mruby/releases{/id}","created_at":"2012-04-19T09:11:15Z","updated_at":"2015-08-19T15:46:27Z","pushed_at":"2015-08-21T06:03:28Z","git_url":"git://github.com/mruby/mruby.git","ssh_url":"git@github.com:mruby/mruby.git","clone_url":"https://github.com/mruby/mruby.git","svn_url":"https://github.com/mruby/mruby","homepage":null,"size":24339,"stargazers_count":3123,"watchers_count":3123,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":477,"mirror_url":null,"open_issues_count":148,"forks":477,"open_issues":148,"watchers":3123,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mruby/mruby/pulls/2922"},"html":{"href":"https://github.com/mruby/mruby/pull/2922"},"issue":{"href":"https://api.github.com/repos/mruby/mruby/issues/2922"},"comments":{"href":"https://api.github.com/repos/mruby/mruby/issues/2922/comments"},"review_comments":{"href":"https://api.github.com/repos/mruby/mruby/pulls/2922/comments"},"review_comment":{"href":"https://api.github.com/repos/mruby/mruby/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mruby/mruby/pulls/2922/commits"},"statuses":{"href":"https://api.github.com/repos/mruby/mruby/statuses/85f0dd7da0fe41310883d9a65156c429135590f5"}}}}