Spring Collections

Spring Collections

I have a list of elements, there are, for example, 100 of them.

List : IList;

I want to get 5 values greater than 10 and I do it like this:

result: = List.Where(ValueIsGreatThan10).Take(5);

Will the "work loop" be executed a minimum number of times and if, for example, the first 5 values in the list will be greater than 5, then only the five will be checked? Or maybe the Where() loop will scan 100 elements, and Take() will return the first 5 results?

Comments

  1. Stefan Glienke It `s genius! The author of this idea deserves to be distinguished at least!
    Thanks for information

    ReplyDelete
  2. Jacek Laskowski I think https://en.wikipedia.org/wiki/Erik_Meijer_(computer_scientist) was at least involved in developing LINQ at Microsoft.

    ReplyDelete

Post a Comment