Remove some unused locals (dotnet/corefx#39956)
authorStephen Toub <stoub@microsoft.com>
Mon, 5 Aug 2019 15:05:14 +0000 (11:05 -0400)
committerGitHub <noreply@github.com>
Mon, 5 Aug 2019 15:05:14 +0000 (11:05 -0400)
commitcd386d1dbbc33fef4d77550b0e0c1d3c40524816
tree9c8512365c23c79bbe19af09dba084380a2e0d1a
parentec7bce1ae964e3c61126de0263e043a263bb4100
Remove some unused locals (dotnet/corefx#39956)

* Remove some unused locals

Trying out various analyzers, including one to flag unused locals.  There are more than this, but this is a first batch.  Some of these are just clean-up.  Others are saving unnecessary cost.  At least one appears to be a real functional bug.

* Address PR feedback

Commit migrated from https://github.com/dotnet/corefx/commit/545d9959aebded62a26d20c7c1bf86785a92e52a
69 files changed:
src/libraries/Common/src/System/Data/ProviderBase/DbConnectionInternal.cs
src/libraries/Common/src/System/Net/CaseInsensitiveAscii.cs
src/libraries/Common/src/System/Net/WebSockets/ManagedWebSocket.cs
src/libraries/Common/src/System/Reflection/Emit/IgnoreAccessChecksToAttributeBuilder.cs
src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/ExpressionBinder.cs
src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableArray_1.Minimal.cs
src/libraries/System.Collections/src/System/Collections/Generic/SortedSet.cs
src/libraries/System.ComponentModel.Composition.Registration/src/System/ComponentModel/Composition/Registration/RegistrationBuilder.cs
src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/GenericServices.cs
src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeDescriptor.cs
src/libraries/System.Composition.Convention/src/System/Composition/Convention/ConventionBuilder.cs
src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ClientConfigurationHost.cs
src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/Configuration.cs
src/libraries/System.Data.Common/src/System/Data/Common/DbDataAdapter.cs
src/libraries/System.Data.Common/src/System/Data/DataRelation.cs
src/libraries/System.Data.Common/src/System/Data/DataSet.cs
src/libraries/System.Data.Common/src/System/Data/DataTable.cs
src/libraries/System.Data.Common/src/System/Data/DataView.cs
src/libraries/System.Data.Common/src/System/Data/Filter/ExpressionParser.cs
src/libraries/System.Data.Common/src/System/Data/Filter/FunctionNode.cs
src/libraries/System.Data.Common/src/System/Data/SQLTypes/SQLDecimal.cs
src/libraries/System.Data.Common/src/System/Data/Select.cs
src/libraries/System.Data.Common/src/System/Data/Selection.cs
src/libraries/System.Data.Common/src/System/Data/XDRSchema.cs
src/libraries/System.Data.Common/src/System/Data/XMLDiffLoader.cs
src/libraries/System.Data.Common/src/System/Data/XmlDataLoader.cs
src/libraries/System.Data.Common/src/System/Xml/XPathNodePointer.cs
src/libraries/System.Data.Common/src/System/Xml/XmlBoundElement.cs
src/libraries/System.Data.Common/src/System/Xml/XmlDataDocument.cs
src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcDataReader.cs
src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcHandle.cs
src/libraries/System.Data.SqlClient/src/System/Data/SqlClient/LocalDBAPI.Common.cs
src/libraries/System.Data.SqlClient/src/System/Data/SqlClient/SqlCommand.cs
src/libraries/System.Data.SqlClient/src/System/Data/SqlClient/SqlConnection.cs
src/libraries/System.Data.SqlClient/src/System/Data/SqlClient/SqlDependency.cs
src/libraries/System.Data.SqlClient/src/System/Data/SqlClient/SqlDependencyListener.cs
src/libraries/System.Data.SqlClient/src/System/Data/SqlClient/TdsParser.cs
src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/DiagnosticSourceEventSource.cs
src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/EventLogInternal.cs
src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterLib.cs
src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceData/CounterSetInstance.cs
src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapPartialResultsProcessor.cs
src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/Domain.cs
src/libraries/System.IO.Compression.Brotli/src/System/IO/Compression/dec/BrotliStream.Decompress.cs
src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpResponseParser.cs
src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ConnectHelper.cs
src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs
src/libraries/System.Net.HttpListener/src/System/Net/Windows/WebSockets/WebSocketBase.cs
src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Tasks.cs
src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEventArgs.Windows.cs
src/libraries/System.Net.WebClient/src/System/Net/WebClient.cs
src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/ReflectionJsonFormatReader.cs
src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/ReflectionJsonFormatWriter.cs
src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ReflectionReader.cs
src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ReflectionXmlFormatWriter.cs
src/libraries/System.Reflection.Context/src/System/Reflection/Context/Custom/CustomType.cs
src/libraries/System.Reflection.Metadata/src/System/Reflection/PortableExecutable/DebugDirectory/DebugDirectoryBuilder.cs
src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/CustomAttributes/RoPseudoCustomAttributeData.cs
src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/Types/Ecma/EcmaGenericTypeParameterType.cs
src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/Types/RoArrayType.cs
src/libraries/System.Runtime.Numerics/src/System/Numerics/BigNumber.cs
src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AesCcm.Unix.cs
src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/KeyInfoRetrievalMethod.cs
src/libraries/System.Security.Principal.Windows/src/System/Security/Principal/WindowsIdentity.cs
src/libraries/System.Text.Json/src/System/Text/Json/Reader/Utf8JsonReader.MultiSegment.cs
src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.cs
src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexCompiler.cs
src/libraries/System.Threading.Channels/src/System/Threading/Channels/BoundedChannel.cs
src/libraries/System.Threading/src/System/Threading/Barrier.cs