Click here to Skip to main content
15,902,032 members
Home / Discussions / C#
   

C#

 
AnswerRe: convert part of a list to an array Pin
VJ Reddy3-Jun-12 7:53
VJ Reddy3-Jun-12 7:53 
GeneralRe: convert part of a list to an array Pin
Richard Andrew x643-Jun-12 8:00
professionalRichard Andrew x643-Jun-12 8:00 
GeneralRe: convert part of a list to an array Pin
Luc Pattyn3-Jun-12 9:00
sitebuilderLuc Pattyn3-Jun-12 9:00 
AnswerRe: convert part of a list to an array Pin
taha bahraminezhad Jooneghani3-Jun-12 8:05
taha bahraminezhad Jooneghani3-Jun-12 8:05 
AnswerRe: convert part of a list to an array PinPopular
Luc Pattyn3-Jun-12 8:58
sitebuilderLuc Pattyn3-Jun-12 8:58 
GeneralRe: convert part of a list to an array Pin
Dave Kreskowiak3-Jun-12 9:15
mveDave Kreskowiak3-Jun-12 9:15 
GeneralRe: convert part of a list to an array Pin
Luc Pattyn3-Jun-12 9:26
sitebuilderLuc Pattyn3-Jun-12 9:26 
GeneralRe: convert part of a list to an array Pin
DaveyM694-Jun-12 8:18
professionalDaveyM694-Jun-12 8:18 
I've just seen this and happened to have reflector open so I've had a look!

GetRange uses Array.Copy to copy to a new list:
C#
List<T> list = new List<T>(count);
Array.Copy(this._items, index, list._items, 0, count);
list._size = count;
return list;

as is ToArray but to an array instead:
C#
T[] destinationArray = new T[this._size];
Array.Copy(this._items, 0, destinationArray, 0, this._size);
return destinationArray;

Now quite what Array.Copy is doing I'm not 100% sure as it's an extern function, so perhaps it's using unmanaged code to block copy?
Dave

Binging is like googling, it just feels dirtier.
Please take your VB.NET out of our nice case sensitive forum.
Astonish us. Be exceptional. (Pete O'Hanlon)

BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)



GeneralRe: convert part of a list to an array Pin
VJ Reddy3-Jun-12 13:51
VJ Reddy3-Jun-12 13:51 
GeneralRe: convert part of a list to an array PinPopular
Luc Pattyn3-Jun-12 14:28
sitebuilderLuc Pattyn3-Jun-12 14:28 
AnswerRe: convert part of a list to an array Pin
Apocalypse Now3-Jun-12 14:09
Apocalypse Now3-Jun-12 14:09 
GeneralRe: convert part of a list to an array Pin
Luc Pattyn3-Jun-12 14:30
sitebuilderLuc Pattyn3-Jun-12 14:30 
GeneralRe: convert part of a list to an array Pin
Apocalypse Now4-Jun-12 14:33
Apocalypse Now4-Jun-12 14:33 
QuestionSign Language Recognition Pin
RimaTeliani3-Jun-12 0:00
RimaTeliani3-Jun-12 0:00 
AnswerRe: Sign Language Recognition Pin
OriginalGriff3-Jun-12 0:29
mveOriginalGriff3-Jun-12 0:29 
GeneralRe: Sign Language Recognition Pin
RimaTeliani3-Jun-12 2:09
RimaTeliani3-Jun-12 2:09 
AnswerRe: Sign Language Recognition Pin
Richard MacCutchan3-Jun-12 0:53
mveRichard MacCutchan3-Jun-12 0:53 
GeneralRe: Sign Language Recognition Pin
RimaTeliani3-Jun-12 2:17
RimaTeliani3-Jun-12 2:17 
AnswerRe: Sign Language Recognition Pin
Eddy Vluggen3-Jun-12 2:55
professionalEddy Vluggen3-Jun-12 2:55 
GeneralRe: Sign Language Recognition Pin
RimaTeliani3-Jun-12 3:06
RimaTeliani3-Jun-12 3:06 
GeneralRe: Sign Language Recognition Pin
Eddy Vluggen3-Jun-12 4:38
professionalEddy Vluggen3-Jun-12 4:38 
GeneralRe: Sign Language Recognition Pin
RimaTeliani3-Jun-12 21:14
RimaTeliani3-Jun-12 21:14 
QuestionHow to sleep the thread in this example? Pin
daCrazyDude2-Jun-12 17:22
daCrazyDude2-Jun-12 17:22 
AnswerRe: How to sleep the thread in this example? Pin
Luc Pattyn3-Jun-12 4:57
sitebuilderLuc Pattyn3-Jun-12 4:57 
AnswerRe: How to sleep the thread in this example? Pin
daCrazyDude6-Jun-12 15:48
daCrazyDude6-Jun-12 15:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.