[Mono-list] List.FindAll method implementation

Juraj Skripsky js at hotfeet.ch
Tue Mar 20 13:06:20 EDT 2007


Hi Miguel and Juan,

I've just noticed the commit to List.FindAll(). Attached is an (small)
optimization for the optimization:

- the resulting List<T> is built directly as an array which is later on
wrapped by a List<T> object. This eliminates the unnecessary overhead of
List.Add().
- the filling of the result array stops as soon as all found items are
processed. If there are no matches at the end of the original list, this
will give an small performance win.

The test-run of the resulting code ran fine and it should always be
faster than the version in svn.


May I commit (with a changelog entry of course)?

- Juraj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: List.patch
Type: text/x-patch
Size: 731 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-list/attachments/20070320/cd654851/attachment.bin 


More information about the Mono-list mailing list