From 39bbb2438674270bd7495d3cfc81d57ea184f638 Mon Sep 17 00:00:00 2001 From: Jonathan Peppers Date: Thu, 16 Apr 2026 09:14:06 -0500 Subject: [PATCH] Remove unused HashSet allocations in HashJavaNames The hashes32 and hashes64 HashSet instances were populated but never read, resulting in unnecessary allocations during type map generation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Utilities/TypeMappingReleaseNativeAssemblyGenerator.cs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/TypeMappingReleaseNativeAssemblyGenerator.cs b/src/Xamarin.Android.Build.Tasks/Utilities/TypeMappingReleaseNativeAssemblyGenerator.cs index 0d15a545ebe..feeecac2453 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/TypeMappingReleaseNativeAssemblyGenerator.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/TypeMappingReleaseNativeAssemblyGenerator.cs @@ -409,19 +409,12 @@ void HashJavaNames (ConstructionState cs) { // We generate both 32-bit and 64-bit hashes at the construction time. Which set will be used depends on the target. // Java map list will also be sorted when the target is known - var hashes32 = new HashSet (); - var hashes64 = new HashSet (); - - // Generate Java type name hashes... for (int i = 0; i < cs.JavaMap.Count; i++) { TypeMapJava entry = cs.JavaMap[i].Instance; // The cast is safe, xxHash will return a 32-bit value which (for convenience) was upcast to 64-bit entry.JavaNameHash32 = (uint)TypeMapHelper.HashJavaName (entry.JavaName, is64Bit: false); - hashes32.Add (entry.JavaNameHash32); - entry.JavaNameHash64 = TypeMapHelper.HashJavaName (entry.JavaName, is64Bit: true); - hashes64.Add (entry.JavaNameHash64); } } }