{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/coreclr/pulls/comments/93166122","pull_request_review_id":13687703,"id":93166122,"diff_hunk":"@@ -110,6 +110,87 @@ public int Count\n             }\n         }\n \n+        public int Length => Count;\n+\n+        public T this[int index]\n+        {\n+            get\n+            {\n+                if (_array == null)\n+                    ThrowHelper.ThrowInvalidOperationException(ExceptionResource.InvalidOperation_NullArray);\n+                if (index < 0 || index >= _count)\n+                    ThrowHelper.ThrowArgumentOutOfRange_IndexException();\n+                Contract.EndContractBlock();\n+\n+                return _array[_offset + index];\n+            }\n+\n+            set\n+            {\n+                if (_array == null)\n+                    ThrowHelper.ThrowInvalidOperationException(ExceptionResource.InvalidOperation_NullArray);\n+                if (index < 0 || index >= _count)\n+                    ThrowHelper.ThrowArgumentOutOfRange_IndexException();\n+                Contract.EndContractBlock();\n+\n+                _array[_offset + index] = value;\n+            }\n+        }\n+\n+        /// <summary>\n+        /// Returns an empty <see cref=\"ArraySegment{T}\"/>\n+        /// </summary>\n+        public static ArraySegment<T> Empty\n+        {\n+            get { return default(ArraySegment<T>); }\n+        }\n+\n+        public ArraySegment<T> Slice(int start) => Slice(start, _count - start);\n+\n+        public ArraySegment<T> Slice(int start, int length)\n+        {\n+            if (_array == null)","path":"src/mscorlib/src/System/ArraySegment.cs","position":43,"original_position":43,"commit_id":"d6c28868a999436e4964409eedf569bd6fad2943","original_commit_id":"d6c28868a999436e4964409eedf569bd6fad2943","user":{"login":"AlexRadch","id":6407980,"avatar_url":"https://avatars.githubusercontent.com/u/6407980?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexRadch","html_url":"https://github.com/AlexRadch","followers_url":"https://api.github.com/users/AlexRadch/followers","following_url":"https://api.github.com/users/AlexRadch/following{/other_user}","gists_url":"https://api.github.com/users/AlexRadch/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexRadch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexRadch/subscriptions","organizations_url":"https://api.github.com/users/AlexRadch/orgs","repos_url":"https://api.github.com/users/AlexRadch/repos","events_url":"https://api.github.com/users/AlexRadch/events{/privacy}","received_events_url":"https://api.github.com/users/AlexRadch/received_events","type":"User","site_admin":false},"body":"Next code protect not just for array.count but for segment._count `if ((uint)start > (uint)_count || (uint)length > (uint)(_count - start)) ThrowHelper.ThrowArgumentOutOfRangeException();`\r\nThis is enough because array.count and segment._count never changed.","created_at":"2016-12-20T03:29:23Z","updated_at":"2016-12-20T03:29:23Z","html_url":"https://github.com/dotnet/coreclr/pull/8593#discussion_r93166122","pull_request_url":"https://api.github.com/repos/dotnet/coreclr/pulls/8593","_links":{"self":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/comments/93166122"},"html":{"href":"https://github.com/dotnet/coreclr/pull/8593#discussion_r93166122"},"pull_request":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/8593"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/coreclr/pulls/8593","id":97529542,"html_url":"https://github.com/dotnet/coreclr/pull/8593","diff_url":"https://github.com/dotnet/coreclr/pull/8593.diff","patch_url":"https://github.com/dotnet/coreclr/pull/8593.patch","issue_url":"https://api.github.com/repos/dotnet/coreclr/issues/8593","number":8593,"state":"open","locked":false,"title":"Add \"slicing\" APIs to ArraySegment<T>","user":{"login":"AlexRadch","id":6407980,"avatar_url":"https://avatars.githubusercontent.com/u/6407980?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexRadch","html_url":"https://github.com/AlexRadch","followers_url":"https://api.github.com/users/AlexRadch/followers","following_url":"https://api.github.com/users/AlexRadch/following{/other_user}","gists_url":"https://api.github.com/users/AlexRadch/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexRadch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexRadch/subscriptions","organizations_url":"https://api.github.com/users/AlexRadch/orgs","repos_url":"https://api.github.com/users/AlexRadch/repos","events_url":"https://api.github.com/users/AlexRadch/events{/privacy}","received_events_url":"https://api.github.com/users/AlexRadch/received_events","type":"User","site_admin":false},"body":"ArraySegment could be much more useful if it had the following additional APIs. See https://github.com/dotnet/corefx/issues/10528","created_at":"2016-12-12T10:41:36Z","updated_at":"2016-12-20T03:29:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c374fc98d95a70d58f7548b34d8ca16735a76a12","assignee":{"login":"AlexGhiondea","id":8396979,"avatar_url":"https://avatars.githubusercontent.com/u/8396979?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexGhiondea","html_url":"https://github.com/AlexGhiondea","followers_url":"https://api.github.com/users/AlexGhiondea/followers","following_url":"https://api.github.com/users/AlexGhiondea/following{/other_user}","gists_url":"https://api.github.com/users/AlexGhiondea/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexGhiondea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexGhiondea/subscriptions","organizations_url":"https://api.github.com/users/AlexGhiondea/orgs","repos_url":"https://api.github.com/users/AlexGhiondea/repos","events_url":"https://api.github.com/users/AlexGhiondea/events{/privacy}","received_events_url":"https://api.github.com/users/AlexGhiondea/received_events","type":"User","site_admin":false},"assignees":[{"login":"AlexGhiondea","id":8396979,"avatar_url":"https://avatars.githubusercontent.com/u/8396979?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexGhiondea","html_url":"https://github.com/AlexGhiondea","followers_url":"https://api.github.com/users/AlexGhiondea/followers","following_url":"https://api.github.com/users/AlexGhiondea/following{/other_user}","gists_url":"https://api.github.com/users/AlexGhiondea/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexGhiondea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexGhiondea/subscriptions","organizations_url":"https://api.github.com/users/AlexGhiondea/orgs","repos_url":"https://api.github.com/users/AlexGhiondea/repos","events_url":"https://api.github.com/users/AlexGhiondea/events{/privacy}","received_events_url":"https://api.github.com/users/AlexGhiondea/received_events","type":"User","site_admin":false},{"login":"joperezr","id":13854455,"avatar_url":"https://avatars.githubusercontent.com/u/13854455?v=3","gravatar_id":"","url":"https://api.github.com/users/joperezr","html_url":"https://github.com/joperezr","followers_url":"https://api.github.com/users/joperezr/followers","following_url":"https://api.github.com/users/joperezr/following{/other_user}","gists_url":"https://api.github.com/users/joperezr/gists{/gist_id}","starred_url":"https://api.github.com/users/joperezr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joperezr/subscriptions","organizations_url":"https://api.github.com/users/joperezr/orgs","repos_url":"https://api.github.com/users/joperezr/repos","events_url":"https://api.github.com/users/joperezr/events{/privacy}","received_events_url":"https://api.github.com/users/joperezr/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/coreclr/pulls/8593/commits","review_comments_url":"https://api.github.com/repos/dotnet/coreclr/pulls/8593/comments","review_comment_url":"https://api.github.com/repos/dotnet/coreclr/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/coreclr/issues/8593/comments","statuses_url":"https://api.github.com/repos/dotnet/coreclr/statuses/d6c28868a999436e4964409eedf569bd6fad2943","head":{"label":"AlexRadch:ArraySegment-Slicing","ref":"ArraySegment-Slicing","sha":"d6c28868a999436e4964409eedf569bd6fad2943","user":{"login":"AlexRadch","id":6407980,"avatar_url":"https://avatars.githubusercontent.com/u/6407980?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexRadch","html_url":"https://github.com/AlexRadch","followers_url":"https://api.github.com/users/AlexRadch/followers","following_url":"https://api.github.com/users/AlexRadch/following{/other_user}","gists_url":"https://api.github.com/users/AlexRadch/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexRadch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexRadch/subscriptions","organizations_url":"https://api.github.com/users/AlexRadch/orgs","repos_url":"https://api.github.com/users/AlexRadch/repos","events_url":"https://api.github.com/users/AlexRadch/events{/privacy}","received_events_url":"https://api.github.com/users/AlexRadch/received_events","type":"User","site_admin":false},"repo":{"id":74931664,"name":"coreclr","full_name":"AlexRadch/coreclr","owner":{"login":"AlexRadch","id":6407980,"avatar_url":"https://avatars.githubusercontent.com/u/6407980?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexRadch","html_url":"https://github.com/AlexRadch","followers_url":"https://api.github.com/users/AlexRadch/followers","following_url":"https://api.github.com/users/AlexRadch/following{/other_user}","gists_url":"https://api.github.com/users/AlexRadch/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexRadch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexRadch/subscriptions","organizations_url":"https://api.github.com/users/AlexRadch/orgs","repos_url":"https://api.github.com/users/AlexRadch/repos","events_url":"https://api.github.com/users/AlexRadch/events{/privacy}","received_events_url":"https://api.github.com/users/AlexRadch/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AlexRadch/coreclr","description":"This repo contains the .NET Core runtime, called CoreCLR, and the base library, called mscorlib. It includes the garbage collector, JIT compiler, base .NET data types and many low-level classes.","fork":true,"url":"https://api.github.com/repos/AlexRadch/coreclr","forks_url":"https://api.github.com/repos/AlexRadch/coreclr/forks","keys_url":"https://api.github.com/repos/AlexRadch/coreclr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AlexRadch/coreclr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AlexRadch/coreclr/teams","hooks_url":"https://api.github.com/repos/AlexRadch/coreclr/hooks","issue_events_url":"https://api.github.com/repos/AlexRadch/coreclr/issues/events{/number}","events_url":"https://api.github.com/repos/AlexRadch/coreclr/events","assignees_url":"https://api.github.com/repos/AlexRadch/coreclr/assignees{/user}","branches_url":"https://api.github.com/repos/AlexRadch/coreclr/branches{/branch}","tags_url":"https://api.github.com/repos/AlexRadch/coreclr/tags","blobs_url":"https://api.github.com/repos/AlexRadch/coreclr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AlexRadch/coreclr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AlexRadch/coreclr/git/refs{/sha}","trees_url":"https://api.github.com/repos/AlexRadch/coreclr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AlexRadch/coreclr/statuses/{sha}","languages_url":"https://api.github.com/repos/AlexRadch/coreclr/languages","stargazers_url":"https://api.github.com/repos/AlexRadch/coreclr/stargazers","contributors_url":"https://api.github.com/repos/AlexRadch/coreclr/contributors","subscribers_url":"https://api.github.com/repos/AlexRadch/coreclr/subscribers","subscription_url":"https://api.github.com/repos/AlexRadch/coreclr/subscription","commits_url":"https://api.github.com/repos/AlexRadch/coreclr/commits{/sha}","git_commits_url":"https://api.github.com/repos/AlexRadch/coreclr/git/commits{/sha}","comments_url":"https://api.github.com/repos/AlexRadch/coreclr/comments{/number}","issue_comment_url":"https://api.github.com/repos/AlexRadch/coreclr/issues/comments{/number}","contents_url":"https://api.github.com/repos/AlexRadch/coreclr/contents/{+path}","compare_url":"https://api.github.com/repos/AlexRadch/coreclr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AlexRadch/coreclr/merges","archive_url":"https://api.github.com/repos/AlexRadch/coreclr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AlexRadch/coreclr/downloads","issues_url":"https://api.github.com/repos/AlexRadch/coreclr/issues{/number}","pulls_url":"https://api.github.com/repos/AlexRadch/coreclr/pulls{/number}","milestones_url":"https://api.github.com/repos/AlexRadch/coreclr/milestones{/number}","notifications_url":"https://api.github.com/repos/AlexRadch/coreclr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AlexRadch/coreclr/labels{/name}","releases_url":"https://api.github.com/repos/AlexRadch/coreclr/releases{/id}","deployments_url":"https://api.github.com/repos/AlexRadch/coreclr/deployments","created_at":"2016-11-28T02:57:54Z","updated_at":"2016-11-28T03:00:19Z","pushed_at":"2016-12-20T02:22:55Z","git_url":"git://github.com/AlexRadch/coreclr.git","ssh_url":"git@github.com:AlexRadch/coreclr.git","clone_url":"https://github.com/AlexRadch/coreclr.git","svn_url":"https://github.com/AlexRadch/coreclr","homepage":"https://docs.microsoft.com/dotnet/","size":124029,"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":"dotnet:master","ref":"master","sha":"04d6bd105ade5f6189a15a6dbb59b082613429a1","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":30092893,"name":"coreclr","full_name":"dotnet/coreclr","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/coreclr","description":"This repo contains the .NET Core runtime, called CoreCLR, and the base library, called mscorlib. It includes the garbage collector, JIT compiler, base .NET data types and many low-level classes.","fork":false,"url":"https://api.github.com/repos/dotnet/coreclr","forks_url":"https://api.github.com/repos/dotnet/coreclr/forks","keys_url":"https://api.github.com/repos/dotnet/coreclr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/coreclr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/coreclr/teams","hooks_url":"https://api.github.com/repos/dotnet/coreclr/hooks","issue_events_url":"https://api.github.com/repos/dotnet/coreclr/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/coreclr/events","assignees_url":"https://api.github.com/repos/dotnet/coreclr/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/coreclr/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/coreclr/tags","blobs_url":"https://api.github.com/repos/dotnet/coreclr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/coreclr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/coreclr/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/coreclr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/coreclr/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/coreclr/languages","stargazers_url":"https://api.github.com/repos/dotnet/coreclr/stargazers","contributors_url":"https://api.github.com/repos/dotnet/coreclr/contributors","subscribers_url":"https://api.github.com/repos/dotnet/coreclr/subscribers","subscription_url":"https://api.github.com/repos/dotnet/coreclr/subscription","commits_url":"https://api.github.com/repos/dotnet/coreclr/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/coreclr/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/coreclr/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/coreclr/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/coreclr/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/coreclr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/coreclr/merges","archive_url":"https://api.github.com/repos/dotnet/coreclr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/coreclr/downloads","issues_url":"https://api.github.com/repos/dotnet/coreclr/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/coreclr/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/coreclr/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/coreclr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/coreclr/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/coreclr/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/coreclr/deployments","created_at":"2015-01-30T22:10:02Z","updated_at":"2016-12-19T23:11:40Z","pushed_at":"2016-12-20T01:38:07Z","git_url":"git://github.com/dotnet/coreclr.git","ssh_url":"git@github.com:dotnet/coreclr.git","clone_url":"https://github.com/dotnet/coreclr.git","svn_url":"https://github.com/dotnet/coreclr","homepage":"https://docs.microsoft.com/dotnet/","size":124290,"stargazers_count":7170,"watchers_count":7170,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1751,"mirror_url":null,"open_issues_count":1048,"forks":1751,"open_issues":1048,"watchers":7170,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/8593"},"html":{"href":"https://github.com/dotnet/coreclr/pull/8593"},"issue":{"href":"https://api.github.com/repos/dotnet/coreclr/issues/8593"},"comments":{"href":"https://api.github.com/repos/dotnet/coreclr/issues/8593/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/8593/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/8593/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/coreclr/statuses/d6c28868a999436e4964409eedf569bd6fad2943"}}}}
{"actor":{"display_login":"AlexRadch"}}