From 1cd8acfa8c3156acf551f338af7ba6e768968612 Mon Sep 17 00:00:00 2001 From: ikpil Date: Fri, 12 May 2023 00:04:14 +0900 Subject: [PATCH] performance 10% --- src/DotRecast.Detour.Crowd/ProximityGrid.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/DotRecast.Detour.Crowd/ProximityGrid.cs b/src/DotRecast.Detour.Crowd/ProximityGrid.cs index 1fb0b75..c57d9c9 100644 --- a/src/DotRecast.Detour.Crowd/ProximityGrid.cs +++ b/src/DotRecast.Detour.Crowd/ProximityGrid.cs @@ -95,7 +95,10 @@ namespace DotRecast.Detour.Crowd long key = CombineKey(x, y); if (_items.TryGetValue(key, out var ids)) { - result.UnionWith(ids); + for (int i = 0; i < ids.Count; ++i) + { + result.Add(ids[i]); + } } } }