{"action":"created","issue":{"url":"https://api.github.com/repos/MetacoSA/NBitcoin/issues/149","repository_url":"https://api.github.com/repos/MetacoSA/NBitcoin","labels_url":"https://api.github.com/repos/MetacoSA/NBitcoin/issues/149/labels{/name}","comments_url":"https://api.github.com/repos/MetacoSA/NBitcoin/issues/149/comments","events_url":"https://api.github.com/repos/MetacoSA/NBitcoin/issues/149/events","html_url":"https://github.com/MetacoSA/NBitcoin/issues/149","id":147609074,"number":149,"title":"Using foreach with Collections","user":{"login":"21E14","id":8286077,"avatar_url":"https://avatars.githubusercontent.com/u/8286077?v=3","gravatar_id":"","url":"https://api.github.com/users/21E14","html_url":"https://github.com/21E14","followers_url":"https://api.github.com/users/21E14/followers","following_url":"https://api.github.com/users/21E14/following{/other_user}","gists_url":"https://api.github.com/users/21E14/gists{/gist_id}","starred_url":"https://api.github.com/users/21E14/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/21E14/subscriptions","organizations_url":"https://api.github.com/users/21E14/orgs","repos_url":"https://api.github.com/users/21E14/repos","events_url":"https://api.github.com/users/21E14/events{/privacy}","received_events_url":"https://api.github.com/users/21E14/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-12T02:02:52Z","updated_at":"2016-04-12T22:37:28Z","closed_at":null,"body":"Would it make sense to use foreach with collections instead of the old-school for loops i.e.:\r\nforeach(var i in tx.Inputs) instead of for(int i = 0 ; i < tx.Inputs.Count ; i++)?"},"comment":{"url":"https://api.github.com/repos/MetacoSA/NBitcoin/issues/comments/209132122","html_url":"https://github.com/MetacoSA/NBitcoin/issues/149#issuecomment-209132122","issue_url":"https://api.github.com/repos/MetacoSA/NBitcoin/issues/149","id":209132122,"user":{"login":"21E14","id":8286077,"avatar_url":"https://avatars.githubusercontent.com/u/8286077?v=3","gravatar_id":"","url":"https://api.github.com/users/21E14","html_url":"https://github.com/21E14","followers_url":"https://api.github.com/users/21E14/followers","following_url":"https://api.github.com/users/21E14/following{/other_user}","gists_url":"https://api.github.com/users/21E14/gists{/gist_id}","starred_url":"https://api.github.com/users/21E14/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/21E14/subscriptions","organizations_url":"https://api.github.com/users/21E14/orgs","repos_url":"https://api.github.com/users/21E14/repos","events_url":"https://api.github.com/users/21E14/events{/privacy}","received_events_url":"https://api.github.com/users/21E14/received_events","type":"User","site_admin":false},"created_at":"2016-04-12T22:37:28Z","updated_at":"2016-04-12T22:37:28Z","body":"Say, in the case of public bool HaveInputs(Transaction tx)) the 'i' is used strictly to retrieve a transaction input, where a var i in tx.Inputs would do. Optimizing for performance, of course, is a very different consideration.\r\n"}}