diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-02-11 00:49:49 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-02-11 00:49:49 -0500 |
commit | 4da9e954df3846d01aa0536f4e8143466a1d62f3 (patch) | |
tree | ac4f969399b844f2c0bee0204b0b3a3c4d83e91d /src/SMAPI.Toolkit/Serialization | |
parent | 233a7d57e6b138dcbd651bb9bc5d0a0c66b207bb (diff) | |
download | SMAPI-4da9e954df3846d01aa0536f4e8143466a1d62f3.tar.gz SMAPI-4da9e954df3846d01aa0536f4e8143466a1d62f3.tar.bz2 SMAPI-4da9e954df3846d01aa0536f4e8143466a1d62f3.zip |
use Array.Empty to avoid unneeded array allocations
Diffstat (limited to 'src/SMAPI.Toolkit/Serialization')
-rw-r--r-- | src/SMAPI.Toolkit/Serialization/Models/Manifest.cs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/SMAPI.Toolkit/Serialization/Models/Manifest.cs b/src/SMAPI.Toolkit/Serialization/Models/Manifest.cs index 46b654a5..4ad97b6d 100644 --- a/src/SMAPI.Toolkit/Serialization/Models/Manifest.cs +++ b/src/SMAPI.Toolkit/Serialization/Models/Manifest.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using System.Runtime.Serialization; using Newtonsoft.Json; @@ -68,7 +69,7 @@ namespace StardewModdingAPI.Toolkit.Serialization.Models this.Description = description; this.Version = version; this.UniqueID = uniqueID; - this.UpdateKeys = new string[0]; + this.UpdateKeys = Array.Empty<string>(); this.ContentPackFor = new ManifestContentPackFor { UniqueID = contentPackFor }; } @@ -77,8 +78,8 @@ namespace StardewModdingAPI.Toolkit.Serialization.Models [OnDeserialized] public void OnDeserialized(StreamingContext context) { - this.Dependencies ??= new IManifestDependency[0]; - this.UpdateKeys ??= new string[0]; + this.Dependencies ??= Array.Empty<IManifestDependency>(); + this.UpdateKeys ??= Array.Empty<string>(); } } } |