-
Notifications
You must be signed in to change notification settings - Fork 35
Description
When parsing thousands of scripts foreach approach generates at least N * 2 unnecessary enumerators, e.g. in TSQL160Parser here and here.
Also somewhere in the deep of generated code it produces lots (~N*10) of enumerators on IList<Identifier> but I was unable to locate this place. It'd be great if this was fixed too.
Also please take a look at this IEnumerable implicit cast wherease the source is List and some code addressing this IEnumerable with foreach could be actually rewritten into more optimal for. And there is another suspicious foreach a couple of lines below which may affect iterating through children objects. Perhaps it will work faster and with less garbage objects for GC if implemented as for loop and index-based access to IList elements.