summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/Reflection/Reflector.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI/Framework/Reflection/Reflector.cs')
-rw-r--r--src/SMAPI/Framework/Reflection/Reflector.cs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/SMAPI/Framework/Reflection/Reflector.cs b/src/SMAPI/Framework/Reflection/Reflector.cs
index 889c7ed6..d5938c3f 100644
--- a/src/SMAPI/Framework/Reflection/Reflector.cs
+++ b/src/SMAPI/Framework/Reflection/Reflector.cs
@@ -1,3 +1,5 @@
+#nullable disable
+
using System;
using System.Linq;
using System.Reflection;
@@ -13,7 +15,7 @@ namespace StardewModdingAPI.Framework.Reflection
** Fields
*********/
/// <summary>The cached fields and methods found via reflection.</summary>
- private readonly MemoryCache Cache = new MemoryCache(typeof(Reflector).FullName);
+ private readonly MemoryCache Cache = new(typeof(Reflector).FullName);
/// <summary>The sliding cache expiration time.</summary>
private readonly TimeSpan SlidingCacheExpiry = TimeSpan.FromMinutes(5);
@@ -268,7 +270,7 @@ namespace StardewModdingAPI.Framework.Reflection
// fetch & cache new value
TMemberInfo result = fetch();
- CacheEntry cacheEntry = new CacheEntry(result != null, result);
+ CacheEntry cacheEntry = new(result != null, result);
this.Cache.Add(key, cacheEntry, new CacheItemPolicy { SlidingExpiration = this.SlidingCacheExpiry });
return result;
}