Re: performance of arraylist.add versus redim preserve
If I know the maximum number of elements that might be added, I dimension an
array first to that size, set the elements of the array to the values then
redim preserve to the size of the actual array needed. This, I think is the
most efficient way if you don't want to change the no. of elements later.
Also, you don't have to cast the element each time you use it later.
--
Dennis in Houston
"Paul" wrote:
> Thanks, all. Good info.
>
> Paul
>
>
>
.
Relevant Pages
- Re: Re: how to read AIS data from encapsulated NMEA VDO sentence
... "Paul" wrote: ... Convert this byte array to a 6 bit bitstream. ... it all works until I get to character arrays ... Demodulated bitstream, eg. 168 bits for a message 1. ... (rec.boats.electronics) - Re: P/Invoke BYTE *
... I did find passing arrays, ... but did not find any reference for passing an array of structures. ... Paul G. Tobey wrote: ... value to pDataBuffer. ... (microsoft.public.dotnet.framework.compactframework) - Re: IOCTL_POWER_XXX method calls
... Paul, I understand how to implement your suggestions if the parameter ... // in the managed array of bytes. ... internal const int DeviceDxOffset = 0; ... BOOL PWM_IOControl (DWORD hOpenContext, DWORD pwCode, PBYTE pBufIn, ... (microsoft.public.dotnet.framework.compactframework) - Re: P/Invoke BYTE *
... An array of structures could be represented as an array of bytes, ... a single structure. ... Paul G. Tobey wrote: ... value to pDataBuffer. ... (microsoft.public.dotnet.framework.compactframework) - Re: Help needed with arrays
... int main ... >> Really good idea to let Paul solve his problem himself. ... > The problem I have now is writing a loop statement to fill the array ... (microsoft.public.vc.language) |
|