Nonbreaking performance tweaks (#17106)
* Avoid doing multiple lookups in dictionaries, avoid doing string interpolation & adding single char strings to a StringBuilder, made some private/internal classes & some private methods static when possible, use FrozenSet for InvalidFileNameChars
* Avoid some array + list allocations & async methods and made some private methods static
* Avoid double lookup of XML attribute (and double null check) & avoid an unneeded lookup before writing to a dictionary
* Avoid some double lookups
# Conflicts:
# src/Umbraco.Core/Services/LocalizedTextService.cs
* Avoid double lookups
# Conflicts:
# src/Umbraco.Core/Services/LocalizedTextService.cs
* Avoid double lookups
* List AsSpan, also to trigger a new build that hopefully goes through
* Avoid concatting strings when using writer & more static
* Updated CollectionBenchmarks to show that ToArray isn't always the fastest & Lists can be iterated nearly as fast as arrays (and that ToList is nearly as fast as ToArray on IReadOnlyLists in .NET 8)
* Fix rebase
* Use explicit types ❤️ (I thought it was the other way round...)
# Conflicts:
# src/Umbraco.Core/Services/LocalizedTextService.cs
* Reduce number of lines in HtmlStringUtilities.Truncate to pass code quality analysis
* Avoid double lookups & allocating empty arrays
* Use native List Find instead of LINQ
This commit is contained in:
@@ -82,7 +82,7 @@ public class SqlServerDatabaseProviderMetadata : IDatabaseProviderMetadata
|
||||
return connectionString;
|
||||
}
|
||||
|
||||
private string HandleIntegratedAuthentication(string connectionString, DatabaseModel databaseModel)
|
||||
private static string HandleIntegratedAuthentication(string connectionString, DatabaseModel databaseModel)
|
||||
{
|
||||
if (databaseModel.IntegratedAuth)
|
||||
{
|
||||
@@ -96,7 +96,7 @@ public class SqlServerDatabaseProviderMetadata : IDatabaseProviderMetadata
|
||||
return connectionString;
|
||||
}
|
||||
|
||||
private string HandleTrustServerCertificate(string connectionString, DatabaseModel databaseModel)
|
||||
private static string HandleTrustServerCertificate(string connectionString, DatabaseModel databaseModel)
|
||||
{
|
||||
if (databaseModel.TrustServerCertificate)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user