Commit 6a382e1f authored by simon.cropp's avatar simon.cropp

change a variable scope to be close to usage

use debug assert instead of ArgNullExceptions because this is an internal constructor so no need to guard to that level
parent db05dc42
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
using System.Collections.Concurrent; using System.Collections.Concurrent;
using System.Collections.Generic; using System.Collections.Generic;
using System.Data; using System.Data;
using System.Diagnostics;
using System.Dynamic; using System.Dynamic;
using System.Linq; using System.Linq;
using System.Reflection; using System.Reflection;
...@@ -262,7 +263,6 @@ class DontMap {} ...@@ -262,7 +263,6 @@ class DontMap {}
{ {
if (info.Deserializer == null) if (info.Deserializer == null)
{ {
var split = 0;
int current = 0; int current = 0;
Func<int> nextSplit = () => Func<int> nextSplit = () =>
...@@ -282,7 +282,7 @@ class DontMap {} ...@@ -282,7 +282,7 @@ class DontMap {}
var otherDeserializer = new List<object>(); var otherDeserializer = new List<object>();
split = nextSplit(); int split = nextSplit();
info.Deserializer = GetDeserializer<T>(identity, reader, 0, split); info.Deserializer = GetDeserializer<T>(identity, reader, 0, split);
if (typeof(U) != typeof(DontMap)) if (typeof(U) != typeof(DontMap))
...@@ -767,10 +767,10 @@ public class GridReader : IDisposable ...@@ -767,10 +767,10 @@ public class GridReader : IDisposable
private readonly string sql; private readonly string sql;
internal GridReader(IDbCommand command, IDataReader reader, IDbConnection connection, string sql) internal GridReader(IDbCommand command, IDataReader reader, IDbConnection connection, string sql)
{ {
if (reader == null) throw new ArgumentNullException("reader"); Debug.Assert(reader != null);
if (connection == null) throw new ArgumentNullException("connection"); Debug.Assert(connection != null);
if (sql == null) throw new ArgumentNullException("sql"); Debug.Assert(sql != null);
if (command == null) throw new ArgumentNullException("command"); Debug.Assert(command != null);
this.sql = sql; this.sql = sql;
this.command = command; this.command = command;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment