(31)Know your loops 招数31: 认识你的循环 for is the fastest way of iterating over a collection, foreach is a little slower, and LINQ queries are slowest.for是遍历集合最快的方法,foreach略慢一些,LINQ查询最慢. 测试代码: using System; using System.Collections.Generic; using System.Li…