[WFC]: Fix yesterday's commit.
authorMartin Baulig <martin.baulig@xamarin.com>
Wed, 19 Aug 2015 11:16:59 +0000 (13:16 +0200)
committerMartin Baulig <martin.baulig@xamarin.com>
Wed, 19 Aug 2015 11:20:29 +0000 (13:20 +0200)
We actually don't need the length check here.  The only place where
the 'ref parameters' could possibly be replaced is at the end of the
private Request() method - to remove the 'IAsyncResult' argument from
and End*() method.

This fixes commit 0b1360c8e35f483c69a3bfef8b3c133e4932da9e and bug #32886.

(cherry picked from commit 1d2c58215fa00192d6306b4474ea4487df4b38e3)

mcs/class/System.ServiceModel/System.ServiceModel/ClientRuntimeChannel.cs

index c46742bd18da84889d5e6acdaea4f20a59ea0e0f..36ea57b5b9fd7b6170cc447d46b2da4cc1f19b26 100644 (file)
@@ -456,31 +456,12 @@ namespace System.ServiceModel.MonoInternal
                        if (parameters == null)
                                throw new ArgumentNullException ("parameters");
 
-                       var pi = method.GetParameters ();
-                       var countInParams = 0;
-                       for (int i = 0; i < pi.Length; i++) {
-                               if (pi [i].IsIn)
-                                       countInParams++;
-                       }
-
-                       if (parameters.Length != countInParams)
-                               throw new InvalidOperationException ();
-
                        object[] p = parameters;
                        var retval = _processDelegate.EndInvoke (ref p, result);
                        if (p == parameters)
                                return retval;
 
-                       int pos = 0;
-                       for (int i = 0; i < pi.Length; i++) {
-                               if (!pi [i].IsOut && !pi [i].ParameterType.IsByRef)
-                                       continue;
-                               parameters [i] = p [pos++];
-                       }
-
-                       if (pos != p.Length)
-                               throw new InvalidOperationException ();
-
+                       Array.Copy (p, parameters, p.Length);
                        return retval;
                }