diff options
author | jbevain <jbevain@gmail.com> | 2010-05-01 20:49:22 +0400 |
---|---|---|
committer | jbevain <jbevain@gmail.com> | 2010-05-01 20:49:22 +0400 |
commit | 473b44c41cefd210e1f9a37421ee5fe127dd3857 (patch) | |
tree | 62ab54249c034f1a56ae881cee73cd96d916484d /Mono.Collections.Generic | |
parent | d1d138b7dd5e6c9f0d1adc63cac9a7509ca5caab (diff) |
add ToArray
Diffstat (limited to 'Mono.Collections.Generic')
-rw-r--r-- | Mono.Collections.Generic/Collection.cs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Mono.Collections.Generic/Collection.cs b/Mono.Collections.Generic/Collection.cs index 7e7f3fe..0fbfccf 100644 --- a/Mono.Collections.Generic/Collection.cs +++ b/Mono.Collections.Generic/Collection.cs @@ -189,6 +189,13 @@ namespace Mono.Collections.Generic { Array.Copy (items, 0, array, arrayIndex, size); } + public T [] ToArray () + { + var array = new T [size]; + Array.Copy (items, 0, array, 0, size); + return array; + } + void CheckIndex (int index) { if (index < 0 || index > size) |