{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/corefx/issues/18420","repository_url":"https://api.github.com/repos/dotnet/corefx","labels_url":"https://api.github.com/repos/dotnet/corefx/issues/18420/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/18420/comments","events_url":"https://api.github.com/repos/dotnet/corefx/issues/18420/events","html_url":"https://github.com/dotnet/corefx/issues/18420","id":221925764,"number":18420,"title":"API Proposal: Span<T> AsReadOnlySpan(this T[]) extension method","user":{"login":"jkotas","id":6668460,"avatar_url":"https://avatars1.githubusercontent.com/u/6668460?v=3","gravatar_id":"","url":"https://api.github.com/users/jkotas","html_url":"https://github.com/jkotas","followers_url":"https://api.github.com/users/jkotas/followers","following_url":"https://api.github.com/users/jkotas/following{/other_user}","gists_url":"https://api.github.com/users/jkotas/gists{/gist_id}","starred_url":"https://api.github.com/users/jkotas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkotas/subscriptions","organizations_url":"https://api.github.com/users/jkotas/orgs","repos_url":"https://api.github.com/users/jkotas/repos","events_url":"https://api.github.com/users/jkotas/events{/privacy}","received_events_url":"https://api.github.com/users/jkotas/received_events","type":"User","site_admin":false},"labels":[{"id":153714228,"url":"https://api.github.com/repos/dotnet/corefx/labels/api-needs-work","name":"api-needs-work","color":"207de5","default":false},{"id":547241922,"url":"https://api.github.com/repos/dotnet/corefx/labels/area-System.Memory","name":"area-System.Memory","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-04-15T04:24:17Z","updated_at":"2017-04-15T04:26:39Z","closed_at":null,"body":"#17414 added extension methods that make it easy to create Span from array using fluent pattern. This proposal adds similar methods to ReadOnlySpan.\r\n\r\n```\r\npublic static class SpanExtensions\r\n{\r\n    public static ReadOnlySpan<T> AsReadOnlySpan<T>(this T[] array);\r\n    public static ReadOnlySpan<T> AsReadOnlySpan<T>(this ArraySegment<T> segment);\r\n}\r\n```\r\n\r\nNote that creating ReadOnlySpan directly using these APIs is not equivalent to creating Span and than casting it to ReadOnlySpan. The later incurs covariance array check that adds unnecessary performance overhead and throws for covariant array. An instance of this problem was fixed in #18419. "},"comment":{"url":"https://api.github.com/repos/dotnet/corefx/issues/comments/294271384","html_url":"https://github.com/dotnet/corefx/issues/18420#issuecomment-294271384","issue_url":"https://api.github.com/repos/dotnet/corefx/issues/18420","id":294271384,"user":{"login":"jkotas","id":6668460,"avatar_url":"https://avatars1.githubusercontent.com/u/6668460?v=3","gravatar_id":"","url":"https://api.github.com/users/jkotas","html_url":"https://github.com/jkotas","followers_url":"https://api.github.com/users/jkotas/followers","following_url":"https://api.github.com/users/jkotas/following{/other_user}","gists_url":"https://api.github.com/users/jkotas/gists{/gist_id}","starred_url":"https://api.github.com/users/jkotas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkotas/subscriptions","organizations_url":"https://api.github.com/users/jkotas/orgs","repos_url":"https://api.github.com/users/jkotas/repos","events_url":"https://api.github.com/users/jkotas/events{/privacy}","received_events_url":"https://api.github.com/users/jkotas/received_events","type":"User","site_admin":false},"created_at":"2017-04-15T04:26:39Z","updated_at":"2017-04-15T04:26:39Z","body":"cc @KrzysztofCwalina @shiftylogic @ahsonkhan "}}
{"actor":{"display_login":"jkotas"}}