From f68b04ceb4d2789f112d268c842b269153e090f7 Mon Sep 17 00:00:00 2001 From: Jonathon Marolf Date: Thu, 23 Feb 2017 14:50:01 -0800 Subject: [PATCH] small tweaks based on Cyrus' feedback --- .../Options/EditorConfigStorageLocation.cs | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/src/Workspaces/Core/Portable/Options/EditorConfigStorageLocation.cs b/src/Workspaces/Core/Portable/Options/EditorConfigStorageLocation.cs index 2654170fe06d4..c58535a654a3d 100644 --- a/src/Workspaces/Core/Portable/Options/EditorConfigStorageLocation.cs +++ b/src/Workspaces/Core/Portable/Options/EditorConfigStorageLocation.cs @@ -27,11 +27,7 @@ public bool TryParseReadonlyDictionary(IReadOnlyDictionary allRa if (allRawConventions.TryGetValue(KeyName, out object value)) { result = _parseValue(value.ToString(), type); - if (result == null) - { - return false; - } - return true; + return result != null; } } else if (_tryParseDictionary != null) @@ -53,19 +49,11 @@ public EditorConfigStorageLocation(string keyName) { if (type == typeof(int)) { - if (int.TryParse(s, out var value)) - { - return value; - } - return null; + return int.TryParse(s, out var value) ? (object)value : null; } else if (type == typeof(bool)) { - if (bool.TryParse(s, out var value)) - { - return value; - } - return null; + return bool.TryParse(s, out var value) ? (object)value : null; } else if (type == typeof(CodeStyleOption)) {