From 24ed0fc6d76c32490e7033d2f62427fac6a1a2c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20W=C3=B3jcik?= Date: Sun, 22 Jan 2023 22:26:29 +0100 Subject: [PATCH] Fix array resize bug (#1908) --- src/Proto.Actor/Utils/TypedDictionary.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Proto.Actor/Utils/TypedDictionary.cs b/src/Proto.Actor/Utils/TypedDictionary.cs index b7c8b6d6e0..07df7dce6c 100644 --- a/src/Proto.Actor/Utils/TypedDictionary.cs +++ b/src/Proto.Actor/Utils/TypedDictionary.cs @@ -35,7 +35,7 @@ public void Add(TValue value) if (id >= _values.Length) { - Array.Resize(ref _values, (int)(id * _growthFactor)); + Array.Resize(ref _values, (int)((id + 1) * _growthFactor)); } _values[id] = value;