Re: How do you cast to array?

From: Neal Gafter (neal.gafter_at_gmail.com)
Date: 01/07/05


Date: 6 Jan 2005 20:57:12 -0800

Yes, I checked this when I implemened the new foreach loop. We had
a debate as to whether we should do anything about it. We decided not
to,
but you can often recover the performance, and more, by doing
List.toArray
before iterating.



Relevant Pages

  • Re: Index of object array
    ... "Spare Change" wrote in ... > What property of rgFiles could be substituted for i? ... Internally the foreach loop queries the collection object for the ... can be used on any kind of collection: If you're iterating over a linked ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Succesfull launch of Jules Verne ATV
    ... There's plenty of time. ... Even if they do recover the redundancy, there's still going to be a ... debate over whether or not to trust it close to the ISS. ...
    (sci.space.station)
  • =?UTF-8?Q?=E7=AD=94=E5=A4=8D:_mkdir_in_the_mounted_partiti?= =?UTF-8?Q?on=C2=A3=C2=ACplease_
    ... You should *never* modify an array that you are iterating over in a ... foreach loop. ... in /data3 mkdir FA00000001 ...
    (perl.beginners)
  • Re: exit loop iteration case
    ... foreach (classA objectA in classAList) ... //now I need to get out of the foreach loop if so,otherwise to keep ... argue that if you structure your code right you'll never need to use it. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: DataTable
    ... It's probably because you are trying to do this inside a foreach loop. ... You can overcome this by iterating over the the columns inside a for ... Prev by Date: ...
    (microsoft.public.dotnet.languages.csharp)