{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/corefx/pulls/comments/170431404","pull_request_review_id":99122304,"id":170431404,"diff_hunk":"@@ -45,5 +45,39 @@ public static void OwnedMemoryTryGetArray()\n                 Assert.Equal(array[i], segment.Array[i]);\n             }\n         }\n+        \n+        [Fact]\n+        public static void TryGetArrayFromEmptyMemory()\n+        {\n+            int[] array = new int[0];\n+            Memory<int> memory = array;\n+\n+            Assert.True(memory.TryGetArray(out ArraySegment<int> segment));\n+            Assert.Same(array, segment.Array);\n+            Assert.Equal(0, segment.Array.Length);\n+\n+            Assert.True(Memory<byte>.Empty.TryGetArray(out ArraySegment<byte> byteSegment));\n+        }\n+\n+        [Fact]\n+        public static void TryGetArrayFromEmptyOwnedMemory()\n+        {\n+            int[] array = new int[0];\n+            OwnedMemory<int> owner = new CustomMemoryForTest<int>(array);\n+\n+            Assert.True(owner.Memory.TryGetArray(out ArraySegment<int> segment));\n+            Assert.Same(array, segment.Array);\n+            Assert.Equal(0, segment.Array.Length);\n+        }\n+\n+        [Fact]\n+        public static void TryGetArrayFromEmptyMemoryAndNegativeIndex()","path":"src/System.Memory/tests/Memory/TryGetArray.cs","position":null,"original_position":30,"commit_id":"2bdd45b4b508b292d6ff709ab7b21f91756086af","original_commit_id":"ce5b663e0850a2dcd254dcc2434fcfef0c30efae","user":{"login":"kasper3","id":33230602,"avatar_url":"https://avatars3.githubusercontent.com/u/33230602?v=4","gravatar_id":"","url":"https://api.github.com/users/kasper3","html_url":"https://github.com/kasper3","followers_url":"https://api.github.com/users/kasper3/followers","following_url":"https://api.github.com/users/kasper3/following{/other_user}","gists_url":"https://api.github.com/users/kasper3/gists{/gist_id}","starred_url":"https://api.github.com/users/kasper3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kasper3/subscriptions","organizations_url":"https://api.github.com/users/kasper3/orgs","repos_url":"https://api.github.com/users/kasper3/repos","events_url":"https://api.github.com/users/kasper3/events{/privacy}","received_events_url":"https://api.github.com/users/kasper3/received_events","type":"User","site_admin":false},"body":"Renamed to `TryGetArrayFromEmptyNonRetrievableOwnedMemory`. Let me know if that sounds strange. 😄 ","created_at":"2018-02-24T20:18:04Z","updated_at":"2018-02-24T20:18:05Z","html_url":"https://github.com/dotnet/corefx/pull/27430#discussion_r170431404","pull_request_url":"https://api.github.com/repos/dotnet/corefx/pulls/27430","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/comments/170431404"},"html":{"href":"https://github.com/dotnet/corefx/pull/27430#discussion_r170431404"},"pull_request":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/27430"}},"in_reply_to_id":170430688},"pull_request":{"url":"https://api.github.com/repos/dotnet/corefx/pulls/27430","id":171176359,"html_url":"https://github.com/dotnet/corefx/pull/27430","diff_url":"https://github.com/dotnet/corefx/pull/27430.diff","patch_url":"https://github.com/dotnet/corefx/pull/27430.patch","issue_url":"https://api.github.com/repos/dotnet/corefx/issues/27430","number":27430,"state":"open","locked":false,"title":"Add tests for empty array in Memory/MemoryMarshal","user":{"login":"kasper3","id":33230602,"avatar_url":"https://avatars3.githubusercontent.com/u/33230602?v=4","gravatar_id":"","url":"https://api.github.com/users/kasper3","html_url":"https://github.com/kasper3","followers_url":"https://api.github.com/users/kasper3/followers","following_url":"https://api.github.com/users/kasper3/following{/other_user}","gists_url":"https://api.github.com/users/kasper3/gists{/gist_id}","starred_url":"https://api.github.com/users/kasper3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kasper3/subscriptions","organizations_url":"https://api.github.com/users/kasper3/orgs","repos_url":"https://api.github.com/users/kasper3/repos","events_url":"https://api.github.com/users/kasper3/events{/privacy}","received_events_url":"https://api.github.com/users/kasper3/received_events","type":"User","site_admin":false},"body":"Depends on https://github.com/dotnet/coreclr/pull/16529","created_at":"2018-02-24T12:18:53Z","updated_at":"2018-02-24T20:18:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"146379563619596e5cb5255ef76d4001e7010688","assignee":{"login":"kasper3","id":33230602,"avatar_url":"https://avatars3.githubusercontent.com/u/33230602?v=4","gravatar_id":"","url":"https://api.github.com/users/kasper3","html_url":"https://github.com/kasper3","followers_url":"https://api.github.com/users/kasper3/followers","following_url":"https://api.github.com/users/kasper3/following{/other_user}","gists_url":"https://api.github.com/users/kasper3/gists{/gist_id}","starred_url":"https://api.github.com/users/kasper3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kasper3/subscriptions","organizations_url":"https://api.github.com/users/kasper3/orgs","repos_url":"https://api.github.com/users/kasper3/repos","events_url":"https://api.github.com/users/kasper3/events{/privacy}","received_events_url":"https://api.github.com/users/kasper3/received_events","type":"User","site_admin":false},"assignees":[{"login":"kasper3","id":33230602,"avatar_url":"https://avatars3.githubusercontent.com/u/33230602?v=4","gravatar_id":"","url":"https://api.github.com/users/kasper3","html_url":"https://github.com/kasper3","followers_url":"https://api.github.com/users/kasper3/followers","following_url":"https://api.github.com/users/kasper3/following{/other_user}","gists_url":"https://api.github.com/users/kasper3/gists{/gist_id}","starred_url":"https://api.github.com/users/kasper3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kasper3/subscriptions","organizations_url":"https://api.github.com/users/kasper3/orgs","repos_url":"https://api.github.com/users/kasper3/repos","events_url":"https://api.github.com/users/kasper3/events{/privacy}","received_events_url":"https://api.github.com/users/kasper3/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":547241922,"url":"https://api.github.com/repos/dotnet/corefx/labels/area-System.Memory","name":"area-System.Memory","color":"d4c5f9","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/corefx/pulls/27430/commits","review_comments_url":"https://api.github.com/repos/dotnet/corefx/pulls/27430/comments","review_comment_url":"https://api.github.com/repos/dotnet/corefx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/27430/comments","statuses_url":"https://api.github.com/repos/dotnet/corefx/statuses/2bdd45b4b508b292d6ff709ab7b21f91756086af","head":{"label":"kasper3:master","ref":"master","sha":"2bdd45b4b508b292d6ff709ab7b21f91756086af","user":{"login":"kasper3","id":33230602,"avatar_url":"https://avatars3.githubusercontent.com/u/33230602?v=4","gravatar_id":"","url":"https://api.github.com/users/kasper3","html_url":"https://github.com/kasper3","followers_url":"https://api.github.com/users/kasper3/followers","following_url":"https://api.github.com/users/kasper3/following{/other_user}","gists_url":"https://api.github.com/users/kasper3/gists{/gist_id}","starred_url":"https://api.github.com/users/kasper3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kasper3/subscriptions","organizations_url":"https://api.github.com/users/kasper3/orgs","repos_url":"https://api.github.com/users/kasper3/repos","events_url":"https://api.github.com/users/kasper3/events{/privacy}","received_events_url":"https://api.github.com/users/kasper3/received_events","type":"User","site_admin":false},"repo":{"id":122737080,"name":"corefx","full_name":"kasper3/corefx","owner":{"login":"kasper3","id":33230602,"avatar_url":"https://avatars3.githubusercontent.com/u/33230602?v=4","gravatar_id":"","url":"https://api.github.com/users/kasper3","html_url":"https://github.com/kasper3","followers_url":"https://api.github.com/users/kasper3/followers","following_url":"https://api.github.com/users/kasper3/following{/other_user}","gists_url":"https://api.github.com/users/kasper3/gists{/gist_id}","starred_url":"https://api.github.com/users/kasper3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kasper3/subscriptions","organizations_url":"https://api.github.com/users/kasper3/orgs","repos_url":"https://api.github.com/users/kasper3/repos","events_url":"https://api.github.com/users/kasper3/events{/privacy}","received_events_url":"https://api.github.com/users/kasper3/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kasper3/corefx","description":"This repo contains the .NET Core foundational libraries, called CoreFX. It includes classes for collections, file systems, console, XML, async and many others. We welcome contributions.","fork":true,"url":"https://api.github.com/repos/kasper3/corefx","forks_url":"https://api.github.com/repos/kasper3/corefx/forks","keys_url":"https://api.github.com/repos/kasper3/corefx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kasper3/corefx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kasper3/corefx/teams","hooks_url":"https://api.github.com/repos/kasper3/corefx/hooks","issue_events_url":"https://api.github.com/repos/kasper3/corefx/issues/events{/number}","events_url":"https://api.github.com/repos/kasper3/corefx/events","assignees_url":"https://api.github.com/repos/kasper3/corefx/assignees{/user}","branches_url":"https://api.github.com/repos/kasper3/corefx/branches{/branch}","tags_url":"https://api.github.com/repos/kasper3/corefx/tags","blobs_url":"https://api.github.com/repos/kasper3/corefx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kasper3/corefx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kasper3/corefx/git/refs{/sha}","trees_url":"https://api.github.com/repos/kasper3/corefx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kasper3/corefx/statuses/{sha}","languages_url":"https://api.github.com/repos/kasper3/corefx/languages","stargazers_url":"https://api.github.com/repos/kasper3/corefx/stargazers","contributors_url":"https://api.github.com/repos/kasper3/corefx/contributors","subscribers_url":"https://api.github.com/repos/kasper3/corefx/subscribers","subscription_url":"https://api.github.com/repos/kasper3/corefx/subscription","commits_url":"https://api.github.com/repos/kasper3/corefx/commits{/sha}","git_commits_url":"https://api.github.com/repos/kasper3/corefx/git/commits{/sha}","comments_url":"https://api.github.com/repos/kasper3/corefx/comments{/number}","issue_comment_url":"https://api.github.com/repos/kasper3/corefx/issues/comments{/number}","contents_url":"https://api.github.com/repos/kasper3/corefx/contents/{+path}","compare_url":"https://api.github.com/repos/kasper3/corefx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kasper3/corefx/merges","archive_url":"https://api.github.com/repos/kasper3/corefx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kasper3/corefx/downloads","issues_url":"https://api.github.com/repos/kasper3/corefx/issues{/number}","pulls_url":"https://api.github.com/repos/kasper3/corefx/pulls{/number}","milestones_url":"https://api.github.com/repos/kasper3/corefx/milestones{/number}","notifications_url":"https://api.github.com/repos/kasper3/corefx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kasper3/corefx/labels{/name}","releases_url":"https://api.github.com/repos/kasper3/corefx/releases{/id}","deployments_url":"https://api.github.com/repos/kasper3/corefx/deployments","created_at":"2018-02-24T12:06:01Z","updated_at":"2018-02-24T12:06:49Z","pushed_at":"2018-02-24T20:16:46Z","git_url":"git://github.com/kasper3/corefx.git","ssh_url":"git@github.com:kasper3/corefx.git","clone_url":"https://github.com/kasper3/corefx.git","svn_url":"https://github.com/kasper3/corefx","homepage":"https://github.com/dotnet/core","size":170675,"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":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dotnet:master","ref":"master","sha":"502ad71e89b0aa3a51d07e99204befb3c85573e8","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","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":26295345,"name":"corefx","full_name":"dotnet/corefx","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","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/corefx","description":"This repo contains the .NET Core foundational libraries, called CoreFX. It includes classes for collections, file systems, console, XML, async and many others. We welcome contributions.","fork":false,"url":"https://api.github.com/repos/dotnet/corefx","forks_url":"https://api.github.com/repos/dotnet/corefx/forks","keys_url":"https://api.github.com/repos/dotnet/corefx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/corefx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/corefx/teams","hooks_url":"https://api.github.com/repos/dotnet/corefx/hooks","issue_events_url":"https://api.github.com/repos/dotnet/corefx/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/corefx/events","assignees_url":"https://api.github.com/repos/dotnet/corefx/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/corefx/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/corefx/tags","blobs_url":"https://api.github.com/repos/dotnet/corefx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/corefx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/corefx/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/corefx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/corefx/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/corefx/languages","stargazers_url":"https://api.github.com/repos/dotnet/corefx/stargazers","contributors_url":"https://api.github.com/repos/dotnet/corefx/contributors","subscribers_url":"https://api.github.com/repos/dotnet/corefx/subscribers","subscription_url":"https://api.github.com/repos/dotnet/corefx/subscription","commits_url":"https://api.github.com/repos/dotnet/corefx/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/corefx/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/corefx/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/corefx/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/corefx/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/corefx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/corefx/merges","archive_url":"https://api.github.com/repos/dotnet/corefx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/corefx/downloads","issues_url":"https://api.github.com/repos/dotnet/corefx/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/corefx/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/corefx/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/corefx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/corefx/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/corefx/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/corefx/deployments","created_at":"2014-11-06T23:42:48Z","updated_at":"2018-02-24T16:17:58Z","pushed_at":"2018-02-24T20:16:49Z","git_url":"git://github.com/dotnet/corefx.git","ssh_url":"git@github.com:dotnet/corefx.git","clone_url":"https://github.com/dotnet/corefx.git","svn_url":"https://github.com/dotnet/corefx","homepage":"https://github.com/dotnet/core","size":170673,"stargazers_count":13425,"watchers_count":13425,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3811,"mirror_url":null,"archived":false,"open_issues_count":2209,"license":null,"forks":3811,"open_issues":2209,"watchers":13425,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/27430"},"html":{"href":"https://github.com/dotnet/corefx/pull/27430"},"issue":{"href":"https://api.github.com/repos/dotnet/corefx/issues/27430"},"comments":{"href":"https://api.github.com/repos/dotnet/corefx/issues/27430/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/27430/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/27430/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/corefx/statuses/2bdd45b4b508b292d6ff709ab7b21f91756086af"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"kasper3"}}