diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-04-13 20:24:14 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-04-13 20:24:14 -0400 |
commit | f39da383a17b368e92fd243cf155b27ba42671f3 (patch) | |
tree | 56c215dfb34da270a7714afd141e76a94c69a2c0 /src/SMAPI/Framework/Utilities | |
parent | 6e9e8aef1ef97e1a4ef4410ce300cb1c47eca986 (diff) | |
download | SMAPI-f39da383a17b368e92fd243cf155b27ba42671f3.tar.gz SMAPI-f39da383a17b368e92fd243cf155b27ba42671f3.tar.bz2 SMAPI-f39da383a17b368e92fd243cf155b27ba42671f3.zip |
enable nullable annotations in SMAPI where no logic changes are needed (#837)
Diffstat (limited to 'src/SMAPI/Framework/Utilities')
-rw-r--r-- | src/SMAPI/Framework/Utilities/TickCacheDictionary.cs | 5 |
1 files changed, 2 insertions, 3 deletions
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; } |