Checking strings against length seem to have better perf (#36443)
authorYoussef Victor <31348972+Youssef1313@users.noreply.github.com>
Tue, 19 May 2020 13:39:51 +0000 (15:39 +0200)
committerGitHub <noreply@github.com>
Tue, 19 May 2020 13:39:51 +0000 (09:39 -0400)
commit1c048bdfc7b7e4dc9b6d8170b63052695b1d8459
treeb873e92b7eb1a2dd0a6e1f1d4cdd6f4c2288372f
parent8c6c7655bb7abc5c4ce769923aa5bea1daee6bd3
Checking strings against length seem to have better perf (#36443)

* Chckecing strings against length seem to have better perf

* Apply suggestions from code review

Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
Co-authored-by: Ben Adams <thundercat@illyriad.co.uk>
* Apply suggestions from code review

Co-authored-by: Ben Adams <thundercat@illyriad.co.uk>
* Update src/libraries/System.Drawing.Common/src/System/Drawing/BitmapSelector.cs

Co-authored-by: Ben Adams <thundercat@illyriad.co.uk>
* Apply suggestions from code review

* Update src/libraries/System.Private.CoreLib/src/System/Reflection/AssemblyNameFormatter.cs

* fix build error

* Update SmtpClient.cs

* Update AssemblyNameFormatter.cs

* Update LoggingEventSource.cs

* Fix build error

* Apply suggestions from code review

* Update src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/SyndicationContent.cs

* Fix build error

* Apply suggestions from code review

Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
Co-authored-by: Ben Adams <thundercat@illyriad.co.uk>
28 files changed:
src/libraries/Common/src/Interop/Linux/cgroups/Interop.cgroups.cs
src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounter.cs
src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterLib.cs
src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Windows.cs
src/libraries/System.Drawing.Common/src/System/Drawing/BitmapSelector.cs
src/libraries/System.IO.IsolatedStorage/src/System/IO/IsolatedStorage/IsolatedStorageFile.cs
src/libraries/System.IO.Packaging/src/System/IO/Packaging/InternalRelationshipCollection.cs
src/libraries/System.IO.Packaging/src/System/IO/Packaging/PackUriHelper.PackUriScheme.cs
src/libraries/System.IO.Packaging/src/System/IO/Packaging/PackUriHelper.cs
src/libraries/System.IO.Packaging/src/System/IO/Packaging/ZipPackage.cs
src/libraries/System.Net.Mail/src/System/Net/Mail/Attachment.cs
src/libraries/System.Net.Mail/src/System/Net/Mail/MailAddress.cs
src/libraries/System.Net.Mail/src/System/Net/Mail/MailAddressCollection.cs
src/libraries/System.Net.Mail/src/System/Net/Mail/MailMessage.cs
src/libraries/System.Net.Mail/src/System/Net/Mail/MailPriority.cs
src/libraries/System.Net.Mail/src/System/Net/Mail/SmtpClient.cs
src/libraries/System.Net.Mail/src/System/Net/Mime/ContentDisposition.cs
src/libraries/System.Net.Mail/src/System/Net/Mime/ContentType.cs
src/libraries/System.Net.Mail/src/System/Net/Mime/HeaderCollection.cs
src/libraries/System.Net.Requests/src/System/Net/FtpControlStream.cs
src/libraries/System.Private.CoreLib/src/System/Reflection/AssemblyNameFormatter.cs
src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/XmlJsonWriter.cs
src/libraries/System.Private.Xml/src/System/Xml/Dom/XmlNodeReader.cs
src/libraries/System.Private.Xml/src/System/Xml/Schema/XmlSchemaSet.cs
src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/MemoryCache.cs
src/mono/netcore/System.Private.CoreLib/src/System/Reflection/Emit/ModuleBuilder.Mono.cs
src/mono/netcore/System.Private.CoreLib/src/System/Reflection/RuntimeModule.cs
src/mono/netcore/System.Private.CoreLib/src/System/RuntimeTypeHandle.cs