int source_pos = sourceIndex - sourceArray.GetLowerBound (0);
int dest_pos = destinationIndex - destinationArray.GetLowerBound (0);
+ if (dest_pos < 0)
+ throw new ArgumentOutOfRangeException ("destinationIndex", "Index was less than the array's lower bound in the first dimension.");
+
// re-ordered to avoid possible integer overflow
if (source_pos > sourceArray.Length - length)
throw new ArgumentException ("length");
[ReliabilityContractAttribute (Consistency.MayCorruptInstance, Cer.MayFail)]
public static void Copy (Array sourceArray, long sourceIndex, Array destinationArray,
- long destinationIndex, long length)
+ long destinationIndex, long length)
{
if (sourceArray == null)
throw new ArgumentNullException ("sourceArray");
public object Current {
get {
- // Exception messages based on MS implementation
+ // Exception messages based on MS implementation
if (currentpos < 0 )
throw new InvalidOperationException (Locale.GetText (
"Enumeration has not started."));
}
#endregion
+
+ internal sealed class FunctorComparer<T> : IComparer<T> {
+ Comparison<T> comparison;
+
+ public FunctorComparer(Comparison<T> comparison) {
+ this.comparison = comparison;
+ }
+
+ public int Compare(T x, T y) {
+ return comparison(x, y);
+ }
+ }
}
}