Reduce lookups needed in ConcurrentDictionaries in ContentNavigationServiceBase (#19603)

Reduce lookups needed in ConcurrentDictionaries and sort using List.Sort, make key removal O(1) by using hashsets and avoid duplicates, remove unneeded .ToList() and other minor tweaks
This commit is contained in:
Henrik
2025-06-30 14:24:04 +02:00
committed by GitHub
parent f9c2b9594f
commit 880d84b030
10 changed files with 77 additions and 58 deletions

View File

@@ -509,8 +509,7 @@ public static class StringExtensions
var convertToHex = input.ConvertToHex();
var hexLength = convertToHex.Length < 32 ? convertToHex.Length : 32;
var hex = convertToHex[..hexLength].PadLeft(32, '0');
Guid output = Guid.Empty;
return Guid.TryParse(hex, out output) ? output : Guid.Empty;
return Guid.TryParse(hex, out Guid output) ? output : Guid.Empty;
}
/// <summary>