From c0563612251b476cb23262ccca993ccd2d8d6bdf Mon Sep 17 00:00:00 2001 From: Wraith2 Date: Wed, 9 Jun 2021 23:47:28 +0100 Subject: [PATCH] address feedback --- .../Data/SqlClient/Server/SqlNormalizer.cs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Server/SqlNormalizer.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Server/SqlNormalizer.cs index 820595e93d..e7dd37a955 100644 --- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Server/SqlNormalizer.cs +++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Server/SqlNormalizer.cs @@ -30,14 +30,7 @@ internal FieldInfoEx(FieldInfo fi, int offset, Normalizer normalizer) internal Normalizer Normalizer { get; private set; } // Sort fields by field offsets. - public int CompareTo(object other) - { - if (other is FieldInfoEx otherFieldInfoEx) - { - return _offset.CompareTo(otherFieldInfoEx._offset); - } - return -1; - } + public int CompareTo(object other) => other is FieldInfoEx otherEx ? _offset.CompareTo(otherEx._offset) : -1; } // The most complex normalizer, a udt normalizer @@ -73,7 +66,7 @@ internal BinaryOrderedUdtNormalizer(Type t, bool isTopLevelUdt) // what to do about nested udts _isTopLevelUdt = true; // else - // this.m_isTopLevelUdt = isTopLevelUdt; + // this._isTopLevelUdt = isTopLevelUdt; FieldInfo[] fields = GetFields(t); @@ -136,7 +129,7 @@ private object DeNormalizeInternal(Type t, Stream s) { object result = null; //if nullable and not the top object, read the null marker - if (!_isTopLevelUdt && typeof(System.Data.SqlTypes.INullable).IsAssignableFrom(t)) + if (!_isTopLevelUdt && typeof(INullable).IsAssignableFrom(t)) { byte nullByte = (byte)s.ReadByte(); if (nullByte == 0)