Author: zoltan
Date: 2007-06-24 09:23:14 -0400 (Sun, 24 Jun 2007)
New Revision: 80623
Modified:
trunk/mcs/class/corlib/System/Array.cs
Log:
2007-06-24 Zoltan Varga <[EMAIL PROTECTED]>
* Array.cs (get_swapper<T>): Use slow_swapper since every T[] is an
object[].
Fixes #81941.
Modified: trunk/mcs/class/corlib/System/Array.cs
===================================================================
--- trunk/mcs/class/corlib/System/Array.cs 2007-06-24 13:08:28 UTC (rev
80622)
+++ trunk/mcs/class/corlib/System/Array.cs 2007-06-24 13:23:14 UTC (rev
80623)
@@ -1137,7 +1137,9 @@
if (array is double[])
return new Swapper (array.double_swapper);
- return new Swapper (array.obj_swapper);
+ // gmcs refuses to compile this
+ //return new Swapper (array.generic_swapper<T>);
+ return new Swapper (array.slow_swapper);
}
#endif
@@ -1366,6 +1368,15 @@
array [j] = val;
}
+#if NET_2_0
+ void generic_swapper<T> (int i, int j) {
+ T[] array = this as T[];
+ T val = array [i];
+ array [i] = array [j];
+ array [j] = val;
+ }
+#endif
+
static int new_gap (int gap)
{
gap = (gap * 10) / 13;
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches