Change some usages of ArrayList to List<T> to avoid calls to the slow ArrayList...
[mono.git] / mcs / class / System / System.Text.RegularExpressions / BaseMachine.cs
index 1d89c4e84fd4fb21a1811a5ad5b85d818b8a4c20..d6104cc6607005fcc3163b8c56e0be3fc79a44e4 100644 (file)
@@ -31,6 +31,7 @@
 using System;\r
 using System.Collections;\r
 using System.Collections.Specialized;\r
+using System.Collections.Generic;\r
 \r
 namespace System.Text.RegularExpressions\r
 {\r
@@ -49,7 +50,7 @@ namespace System.Text.RegularExpressions
 \r
                virtual public string [] Split (Regex regex, string input, int count, int startat)\r
                {\r
-                       ArrayList splits = new ArrayList ();\r
+                       var splits = new List<string> ();\r
                        if (count == 0)\r
                                count = Int32.MaxValue;\r
 \r
@@ -88,7 +89,7 @@ namespace System.Text.RegularExpressions
                        if (!regex.RightToLeft && ptr <= input.Length)\r
                                splits.Add (input.Substring (ptr));\r
 \r
-                       return (string []) splits.ToArray (typeof (string));\r
+                       return splits.ToArray ();
                }\r
 \r
                virtual public Match Scan (Regex regex, string text, int start, int end)\r