Remove duplicate code
authorSaurabh Singh <sausing@microsoft.com>
Thu, 13 Feb 2020 23:59:23 +0000 (15:59 -0800)
committerSaurabh Singh <sausing@microsoft.com>
Thu, 13 Feb 2020 23:59:23 +0000 (15:59 -0800)
src/libraries/System.Data.OleDb/src/OleDbCommand.cs

index 23d7124..8bae901 100644 (file)
@@ -419,7 +419,7 @@ namespace System.Data.OleDb
                 ordinals[i] = (IntPtr)(i + 1);
             }
 
-            OleDbHResult hr;
+            IntPtr bindingPtr;
 
             if (ODB.IsRunningOnX86)
             {
@@ -433,17 +433,19 @@ namespace System.Data.OleDb
                 }
                 fixed (tagDBPARAMBINDINFO_x86* p = &bindInfo_x86[0])
                 {
-                    hr = commandWithParameters.SetParameterInfo((IntPtr)bindInfo.Length, ordinals, (IntPtr)p);
+                    bindingPtr = (IntPtr)p;
                 }
             }
             else
             {
                 fixed (tagDBPARAMBINDINFO* p = &bindInfo[0])
                 {
-                    hr = commandWithParameters.SetParameterInfo((IntPtr)bindInfo.Length, ordinals, (IntPtr)p);
+                    bindingPtr = (IntPtr)p;
                 }
             }
 
+            OleDbHResult hr = commandWithParameters.SetParameterInfo((IntPtr)bindInfo.Length, ordinals, (IntPtr)bindingPtr);
+
             if (hr < 0)
             {
                 ProcessResults(hr);