diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-04-06 18:25:00 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-04-06 18:25:00 -0400 |
commit | 077d8e4f401ad1806c6af0540f432366314a2300 (patch) | |
tree | 525c6787f90a1e962f9a3b84ee495b2d0e8e2cc8 /src/SMAPI.Web/Controllers | |
parent | 0539bb8f3705e5c50d0e5790e2af97f39aed04b8 (diff) | |
download | SMAPI-077d8e4f401ad1806c6af0540f432366314a2300.tar.gz SMAPI-077d8e4f401ad1806c6af0540f432366314a2300.tar.bz2 SMAPI-077d8e4f401ad1806c6af0540f432366314a2300.zip |
remove some unused/redundant code
Diffstat (limited to 'src/SMAPI.Web/Controllers')
-rw-r--r-- | src/SMAPI.Web/Controllers/JsonValidatorController.cs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/SMAPI.Web/Controllers/JsonValidatorController.cs b/src/SMAPI.Web/Controllers/JsonValidatorController.cs index bcd4097a..985f91ae 100644 --- a/src/SMAPI.Web/Controllers/JsonValidatorController.cs +++ b/src/SMAPI.Web/Controllers/JsonValidatorController.cs @@ -161,7 +161,7 @@ namespace StardewModdingAPI.Web.Controllers return this.View("Index", this.GetModel(result.ID, schemaName, isEditView: true).SetContent(input, null).SetUploadError(result.UploadError)); // redirect to view - return this.Redirect(this.Url.PlainAction("Index", "JsonValidator", new { schemaName = schemaName, id = result.ID })); + return this.Redirect(this.Url.PlainAction("Index", "JsonValidator", new { schemaName, id = result.ID })); } @@ -317,13 +317,10 @@ namespace StardewModdingAPI.Web.Controllers /// <param name="key">The case-insensitive field key.</param> private T GetExtensionField<T>(JSchema schema, string key) { - if (schema.ExtensionData != null) + foreach ((string curKey, JToken value) in schema.ExtensionData) { - foreach ((string curKey, JToken value) in schema.ExtensionData) - { - if (curKey.Equals(key, StringComparison.OrdinalIgnoreCase)) - return value.ToObject<T>(); - } + if (curKey.Equals(key, StringComparison.OrdinalIgnoreCase)) + return value.ToObject<T>(); } return default; |