From 5a5e5549df8216a094af9513c51e325605824e78 Mon Sep 17 00:00:00 2001 From: Fernando Diaz Toledano Date: Thu, 30 Jan 2025 09:38:18 +0100 Subject: [PATCH 1/2] Fix warnings --- src/Neo/Persistence/DataCache.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Neo/Persistence/DataCache.cs b/src/Neo/Persistence/DataCache.cs index 016bed2ee2..14476cbb71 100644 --- a/src/Neo/Persistence/DataCache.cs +++ b/src/Neo/Persistence/DataCache.cs @@ -316,7 +316,7 @@ public bool Contains(StorageKey key) /// The key of the entry. /// A delegate used to create the entry if it doesn't exist. If the entry already exists, the factory will not be used. /// The cached data. Or if it doesn't exist and the is not provided. - public StorageItem? GetAndChange(StorageKey key, Func? factory = null) + public StorageItem? GetAndChange(StorageKey key, [NotNullIfNotNull(nameof(factory))] Func? factory) { lock (_dictionary) { From 97f7ce5164a923ade9df2b24376fb29708ac68e2 Mon Sep 17 00:00:00 2001 From: Shargon Date: Thu, 30 Jan 2025 00:40:25 -0800 Subject: [PATCH 2/2] Update src/Neo/Persistence/DataCache.cs --- src/Neo/Persistence/DataCache.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Neo/Persistence/DataCache.cs b/src/Neo/Persistence/DataCache.cs index 14476cbb71..88a290798e 100644 --- a/src/Neo/Persistence/DataCache.cs +++ b/src/Neo/Persistence/DataCache.cs @@ -316,7 +316,7 @@ public bool Contains(StorageKey key) /// The key of the entry. /// A delegate used to create the entry if it doesn't exist. If the entry already exists, the factory will not be used. /// The cached data. Or if it doesn't exist and the is not provided. - public StorageItem? GetAndChange(StorageKey key, [NotNullIfNotNull(nameof(factory))] Func? factory) + public StorageItem? GetAndChange(StorageKey key, [NotNullIfNotNull(nameof(factory))] Func? factory = null) { lock (_dictionary) {