Skip to content

Commit ccd7684

Browse files
Copilotjaviercn
andcommitted
Make _serializerCache static readonly to avoid creating dictionaries per instance
Co-authored-by: javiercn <[email protected]>
1 parent c3bfee4 commit ccd7684

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Components/Components/src/PersistentStateValueProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ internal sealed class PersistentStateValueProvider(PersistentComponentState stat
1919
{
2020
private static readonly ConcurrentDictionary<(string, string, string), byte[]> _keyCache = new();
2121
private static readonly ConcurrentDictionary<(Type, string), PropertyGetter> _propertyGetterCache = new();
22-
private readonly ConcurrentDictionary<Type, IPersistentComponentStateSerializer?> _serializerCache = new();
22+
private static readonly ConcurrentDictionary<Type, IPersistentComponentStateSerializer?> _serializerCache = new();
2323

2424
private readonly Dictionary<ComponentState, PersistingComponentStateSubscription> _subscriptions = [];
2525

0 commit comments

Comments
 (0)