Does list.count physically iterate through the list to count it, or does it keep a pointer

后端 未结 5 1900
臣服心动
臣服心动 2021-01-11 12:55

I am stepping through a large list of object to do some stuff regarding said objects in the list.

During my iteration, I will remove some objects from the list depen

5条回答
  •  孤街浪徒
    2021-01-11 13:57

    As stated here under the remarks tab http://msdn.microsoft.com/en-us/library/27b47ht3(v=vs.110).aspx

    Retrieving the value of this property is an O(1) operation.

    Which means no iteration is occurring.

提交回复
热议问题