Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Comments on Do Where and OfType preserve List capacity?
Post
Do Where and OfType preserve List capacity?
+3
−0
Unless I am mistaken, myList.Select(a => a).ToList()
initializes the resulting list to the capacity of myList.Count
. Does myList.Where(a => true).ToList()
do so or does it build up from the initial capacity? What about OfType
?
1 comment thread