I’m pretty sure the answer to this is ‘yes’, but just in case:
If you’re using ConvertAll() to convert elements of an input list to an output list, is the output list guaranteed to be in the same order as the input list?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There is no explicit guarantee in the documentation that this is the case. The documentation only specifies that elements will be individually passed to the delegate and then put into the new
List<T>. It doesn’t ever specify order.However the behavior today is that elements are returned in order and there is no conceivable reason this would ever change.
Reference: http://msdn.microsoft.com/en-us/library/73fe8cwf.aspx