{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/corefx/issues/14170","repository_url":"https://api.github.com/repos/dotnet/corefx","labels_url":"https://api.github.com/repos/dotnet/corefx/issues/14170/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/14170/comments","events_url":"https://api.github.com/repos/dotnet/corefx/issues/14170/events","html_url":"https://github.com/dotnet/corefx/issues/14170","id":193240092,"number":14170,"title":"Proposal: Make it easier to iterate through an ArraySegment","user":{"login":"jamesqo","id":9159214,"avatar_url":"https://avatars.githubusercontent.com/u/9159214?v=3","gravatar_id":"","url":"https://api.github.com/users/jamesqo","html_url":"https://github.com/jamesqo","followers_url":"https://api.github.com/users/jamesqo/followers","following_url":"https://api.github.com/users/jamesqo/following{/other_user}","gists_url":"https://api.github.com/users/jamesqo/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesqo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesqo/subscriptions","organizations_url":"https://api.github.com/users/jamesqo/orgs","repos_url":"https://api.github.com/users/jamesqo/repos","events_url":"https://api.github.com/users/jamesqo/events{/privacy}","received_events_url":"https://api.github.com/users/jamesqo/received_events","type":"User","site_admin":false},"labels":[{"id":163655927,"url":"https://api.github.com/repos/dotnet/corefx/labels/api-approved","name":"api-approved","color":"159818","default":false},{"id":174276033,"url":"https://api.github.com/repos/dotnet/corefx/labels/area-System.Runtime","name":"area-System.Runtime","color":"d4c5f9","default":false},{"id":337781680,"url":"https://api.github.com/repos/dotnet/corefx/labels/netfx-port-consider","name":"netfx-port-consider","color":"5319e7","default":false},{"id":145399958,"url":"https://api.github.com/repos/dotnet/corefx/labels/up%20for%20grabs","name":"up for grabs","color":"159818","default":false}],"state":"open","locked":false,"assignee":{"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},"assignees":[{"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}],"milestone":{"url":"https://api.github.com/repos/dotnet/corefx/milestones/5","html_url":"https://github.com/dotnet/corefx/milestone/5","labels_url":"https://api.github.com/repos/dotnet/corefx/milestones/5/labels","id":1328080,"number":5,"title":"Future","description":"Milestone tracking the issues triaged for an unspecified future release","creator":{"login":"joshfree","id":1302850,"avatar_url":"https://avatars.githubusercontent.com/u/1302850?v=3","gravatar_id":"","url":"https://api.github.com/users/joshfree","html_url":"https://github.com/joshfree","followers_url":"https://api.github.com/users/joshfree/followers","following_url":"https://api.github.com/users/joshfree/following{/other_user}","gists_url":"https://api.github.com/users/joshfree/gists{/gist_id}","starred_url":"https://api.github.com/users/joshfree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshfree/subscriptions","organizations_url":"https://api.github.com/users/joshfree/orgs","repos_url":"https://api.github.com/users/joshfree/repos","events_url":"https://api.github.com/users/joshfree/events{/privacy}","received_events_url":"https://api.github.com/users/joshfree/received_events","type":"User","site_admin":false},"open_issues":698,"closed_issues":5,"state":"open","created_at":"2015-09-29T00:25:45Z","updated_at":"2016-12-09T01:59:47Z","due_on":null,"closed_at":null},"comments":27,"created_at":"2016-12-02T23:07:09Z","updated_at":"2016-12-09T14:32:19Z","closed_at":null,"body":"## Approved API shape\r\n\r\n```cs\r\npublic struct ArraySegment<T>\r\n{\r\n    public Enumerator GetEnumerator();\r\n\r\n    // Change existing internal class ArraySegmentEnumerator to:\r\n    public struct Enumerator\r\n    {\r\n        public bool MoveNext();\r\n        public T Current { get; }\r\n    }\r\n}\r\n````\r\n\r\nValue: Saves 1 boxing per enumerator:\r\n``` C#\r\nforeach (T item in ArraySegmentReturningMethod()) { }\r\n```\r\n\r\n**Note:** I know that `Span` is supposed to supplant `ArraySegment`, this was added way back in 2.0, etc. However, the indexer seems so trivial to add and could help increase readability of existing code."},"comment":{"url":"https://api.github.com/repos/dotnet/corefx/issues/comments/266026956","html_url":"https://github.com/dotnet/corefx/issues/14170#issuecomment-266026956","issue_url":"https://api.github.com/repos/dotnet/corefx/issues/14170","id":266026956,"user":{"login":"stephentoub","id":2642209,"avatar_url":"https://avatars.githubusercontent.com/u/2642209?v=3","gravatar_id":"","url":"https://api.github.com/users/stephentoub","html_url":"https://github.com/stephentoub","followers_url":"https://api.github.com/users/stephentoub/followers","following_url":"https://api.github.com/users/stephentoub/following{/other_user}","gists_url":"https://api.github.com/users/stephentoub/gists{/gist_id}","starred_url":"https://api.github.com/users/stephentoub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephentoub/subscriptions","organizations_url":"https://api.github.com/users/stephentoub/orgs","repos_url":"https://api.github.com/users/stephentoub/repos","events_url":"https://api.github.com/users/stephentoub/events{/privacy}","received_events_url":"https://api.github.com/users/stephentoub/received_events","type":"User","site_admin":false},"created_at":"2016-12-09T14:32:19Z","updated_at":"2016-12-09T14:32:19Z","body":"Dispose should be public.  Reset can be an explicit interface implementation."}}
{"actor":{"display_login":"stephentoub"}}