摘要:
(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.Linq;using System.Text;using System.Data;using System.Diagn 阅读全文