{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/corefx/issues/5449","repository_url":"https://api.github.com/repos/dotnet/corefx","labels_url":"https://api.github.com/repos/dotnet/corefx/issues/5449/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/5449/comments","events_url":"https://api.github.com/repos/dotnet/corefx/issues/5449/events","html_url":"https://github.com/dotnet/corefx/issues/5449","id":126817541,"number":5449,"title":"ForRef and MapRef extension method for array","user":{"login":"Thaina","id":1042507,"avatar_url":"https://avatars.githubusercontent.com/u/1042507?v=3","gravatar_id":"","url":"https://api.github.com/users/Thaina","html_url":"https://github.com/Thaina","followers_url":"https://api.github.com/users/Thaina/followers","following_url":"https://api.github.com/users/Thaina/following{/other_user}","gists_url":"https://api.github.com/users/Thaina/gists{/gist_id}","starred_url":"https://api.github.com/users/Thaina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Thaina/subscriptions","organizations_url":"https://api.github.com/users/Thaina/orgs","repos_url":"https://api.github.com/users/Thaina/repos","events_url":"https://api.github.com/users/Thaina/events{/privacy}","received_events_url":"https://api.github.com/users/Thaina/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":153713253,"url":"https://api.github.com/repos/dotnet/corefx/labels/area-System.Linq","name":"area-System.Linq","color":"d4c5f9","default":false}],"state":"closed","locked":false,"assignee":{"login":"VSadov","id":8218165,"avatar_url":"https://avatars.githubusercontent.com/u/8218165?v=3","gravatar_id":"","url":"https://api.github.com/users/VSadov","html_url":"https://github.com/VSadov","followers_url":"https://api.github.com/users/VSadov/followers","following_url":"https://api.github.com/users/VSadov/following{/other_user}","gists_url":"https://api.github.com/users/VSadov/gists{/gist_id}","starred_url":"https://api.github.com/users/VSadov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VSadov/subscriptions","organizations_url":"https://api.github.com/users/VSadov/orgs","repos_url":"https://api.github.com/users/VSadov/repos","events_url":"https://api.github.com/users/VSadov/events{/privacy}","received_events_url":"https://api.github.com/users/VSadov/received_events","type":"User","site_admin":false},"assignees":[{"login":"VSadov","id":8218165,"avatar_url":"https://avatars.githubusercontent.com/u/8218165?v=3","gravatar_id":"","url":"https://api.github.com/users/VSadov","html_url":"https://github.com/VSadov","followers_url":"https://api.github.com/users/VSadov/followers","following_url":"https://api.github.com/users/VSadov/following{/other_user}","gists_url":"https://api.github.com/users/VSadov/gists{/gist_id}","starred_url":"https://api.github.com/users/VSadov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VSadov/subscriptions","organizations_url":"https://api.github.com/users/VSadov/orgs","repos_url":"https://api.github.com/users/VSadov/repos","events_url":"https://api.github.com/users/VSadov/events{/privacy}","received_events_url":"https://api.github.com/users/VSadov/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/milestones/Future","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":658,"closed_issues":390,"state":"open","created_at":"2015-09-29T00:25:45Z","updated_at":"2016-11-19T00:35:55Z","due_on":null,"closed_at":null},"comments":22,"created_at":"2016-01-15T06:49:11Z","updated_at":"2016-11-19T00:35:55Z","closed_at":"2016-11-19T00:35:55Z","body":"It is an easy implement to let foreach for reference in array\nI want it to be included in official System.Linq library\n\n```\npublic delegate void RefAction<T>(ref T item);\npublic static T[] ForRef<T>(this T[] array,RefAction<T> action)\n{\n    int i = 0;\n    while(i < array.Length)\n    {\n        action(ref array[i]);\n        i++;\n    }\n    return array; /// return self to chain with Linq\n}\n\npublic delegate void RefFunction<T,R>(ref T item,out R obj);\npublic static R[] MapRef<T,R>(this T[] array,RefFunction<T,R> func)\n{\n    int i = 0;\n    var res = new R[array.Length];\n    while(i < array.Length)\n    {\n        func(ref array[i],out res[i]);\n        i++;\n    }\n\n    return res;\n}\n```\n\nAlso it could be great if this pattern also allowed in Dictionary and List\n\nI want to discus first then I may create a fork and pull request by myself\n"},"comment":{"url":"https://api.github.com/repos/dotnet/corefx/issues/comments/261677771","html_url":"https://github.com/dotnet/corefx/issues/5449#issuecomment-261677771","issue_url":"https://api.github.com/repos/dotnet/corefx/issues/5449","id":261677771,"user":{"login":"VSadov","id":8218165,"avatar_url":"https://avatars.githubusercontent.com/u/8218165?v=3","gravatar_id":"","url":"https://api.github.com/users/VSadov","html_url":"https://github.com/VSadov","followers_url":"https://api.github.com/users/VSadov/followers","following_url":"https://api.github.com/users/VSadov/following{/other_user}","gists_url":"https://api.github.com/users/VSadov/gists{/gist_id}","starred_url":"https://api.github.com/users/VSadov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VSadov/subscriptions","organizations_url":"https://api.github.com/users/VSadov/orgs","repos_url":"https://api.github.com/users/VSadov/repos","events_url":"https://api.github.com/users/VSadov/events{/privacy}","received_events_url":"https://api.github.com/users/VSadov/received_events","type":"User","site_admin":false},"created_at":"2016-11-19T00:35:55Z","updated_at":"2016-11-19T00:35:55Z","body":"For the most part LINQ is a library of composable query-like operators that work with sequences. \r\nIt would not be the right place for an extension that specifically targets arrays with the purpose of in-place mutation."}}
{"actor":{"display_login":"VSadov"}}