From ad4d065fe748b4f3f32a8bf03e9a96132e1a0c79 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 9 Apr 2022 13:10:54 -0400 Subject: simplify code with generic Enum.GetValues --- src/SMAPI.Web/Views/LogParser/Index.cshtml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/SMAPI.Web/Views/LogParser/Index.cshtml b/src/SMAPI.Web/Views/LogParser/Index.cshtml index ff8aa003..cf7e0a5c 100644 --- a/src/SMAPI.Web/Views/LogParser/Index.cshtml +++ b/src/SMAPI.Web/Views/LogParser/Index.cshtml @@ -16,18 +16,15 @@ IDictionary contentPacks = Model.GetContentPacksByMod(); IDictionary defaultFilters = Enum - .GetValues(typeof(LogLevel)) - .Cast() + .GetValues() .ToDictionary(level => level.ToString().ToLower(), level => level != LogLevel.Trace); IDictionary logLevels = Enum - .GetValues(typeof(LogLevel)) - .Cast() + .GetValues() .ToDictionary(level => (int)level, level => level.ToString().ToLower()); IDictionary logSections = Enum - .GetValues(typeof(LogSection)) - .Cast() + .GetValues() .ToDictionary(section => (int)section, section => section.ToString()); string curPageUrl = this.Url.PlainAction("Index", "LogParser", new { id = Model.PasteID }, absoluteUrl: true); -- cgit