summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/Utilities
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI/Framework/Utilities')
-rw-r--r--src/SMAPI/Framework/Utilities/ContextHash.cs2
-rw-r--r--src/SMAPI/Framework/Utilities/TickCacheDictionary.cs5
2 files changed, 2 insertions, 5 deletions
diff --git a/src/SMAPI/Framework/Utilities/ContextHash.cs b/src/SMAPI/Framework/Utilities/ContextHash.cs
index 46b9099e..6c0fdc90 100644
--- a/src/SMAPI/Framework/Utilities/ContextHash.cs
+++ b/src/SMAPI/Framework/Utilities/ContextHash.cs
@@ -1,5 +1,3 @@
-#nullable disable
-
using System;
using System.Collections.Generic;
diff --git a/src/SMAPI/Framework/Utilities/TickCacheDictionary.cs b/src/SMAPI/Framework/Utilities/TickCacheDictionary.cs
index 94ce0069..20d206e2 100644
--- a/src/SMAPI/Framework/Utilities/TickCacheDictionary.cs
+++ b/src/SMAPI/Framework/Utilities/TickCacheDictionary.cs
@@ -1,5 +1,3 @@
-#nullable disable
-
using System;
using System.Collections.Generic;
@@ -9,6 +7,7 @@ namespace StardewModdingAPI.Framework.Utilities
/// <typeparam name="TKey">The dictionary key type.</typeparam>
/// <typeparam name="TValue">The dictionary value type.</typeparam>
internal class TickCacheDictionary<TKey, TValue>
+ where TKey : notnull
{
/*********
** Fields
@@ -36,7 +35,7 @@ namespace StardewModdingAPI.Framework.Utilities
}
// fetch value
- if (!this.Cache.TryGetValue(cacheKey, out TValue cached))
+ if (!this.Cache.TryGetValue(cacheKey, out TValue? cached))
this.Cache[cacheKey] = cached = get();
return cached;
}