diff --git a/1.4/Assemblies/PerformanceFish.dll b/1.4/Assemblies/PerformanceFish.dll index a6ced95..57ae77a 100644 Binary files a/1.4/Assemblies/PerformanceFish.dll and b/1.4/Assemblies/PerformanceFish.dll differ diff --git a/1.4/Assemblies/PerformanceFish.pdb b/1.4/Assemblies/PerformanceFish.pdb index 7ca2efb..a87a9ab 100644 Binary files a/1.4/Assemblies/PerformanceFish.pdb and b/1.4/Assemblies/PerformanceFish.pdb differ diff --git a/1.5/Assemblies/PerformanceFish.dll b/1.5/Assemblies/PerformanceFish.dll index 7619f59..ff62dd2 100644 Binary files a/1.5/Assemblies/PerformanceFish.dll and b/1.5/Assemblies/PerformanceFish.dll differ diff --git a/1.5/Assemblies/PerformanceFish.pdb b/1.5/Assemblies/PerformanceFish.pdb index e3874ec..bf2437e 100644 Binary files a/1.5/Assemblies/PerformanceFish.pdb and b/1.5/Assemblies/PerformanceFish.pdb differ diff --git a/Source/PerformanceFish/Directory.Build.Props b/Source/PerformanceFish/Directory.Build.Props index 56e0845..c681817 100644 --- a/Source/PerformanceFish/Directory.Build.Props +++ b/Source/PerformanceFish/Directory.Build.Props @@ -4,7 +4,7 @@ PerformanceFish PerformanceFish bradson - 0.6.0.1 + 0.6.1.0 LICENSE net48 preview diff --git a/Source/PerformanceFish/Listers/Things.cs b/Source/PerformanceFish/Listers/Things.cs index 34ede5f..60fc1bb 100644 --- a/Source/PerformanceFish/Listers/Things.cs +++ b/Source/PerformanceFish/Listers/Things.cs @@ -560,7 +560,17 @@ public sealed class Things : ClassWithFishPatches public readonly FishTable ThingsByType = new() { ValueInitializer = static type - => (IList)Activator.CreateInstance(typeof(IndexedFishSet<>).MakeGenericType(type)) + => (IList)_thingsListInitializerDefinition.MakeGenericMethod(type).Invoke(null, null) }; + + private static readonly MethodInfo _thingsListInitializerDefinition + = methodof(InitializeThingsList).GetGenericMethodDefinition(); + + public static unsafe IndexedFishSet InitializeThingsList() where T : Thing +#pragma warning disable CS8622 + => new(static () => new(0, keyHashCodeByRefGetter: &GetKeyByRef, keyHashCodeGetter: &ThingHelper.GetKey)); +#pragma warning restore CS8622 + + private static int GetKeyByRef(ref T thing) where T : Thing => thing.GetKey(); } } \ No newline at end of file