From b60e7246fbd5b22fd682e9acc820f0a72007a7f7 Mon Sep 17 00:00:00 2001 From: Mundairson Date: Sat, 9 Jun 2018 16:02:51 +0100 Subject: [PATCH] Converted to simple pattern matching. --- src/Umbraco.Web/UmbracoHelper.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Umbraco.Web/UmbracoHelper.cs b/src/Umbraco.Web/UmbracoHelper.cs index d6f8efe390..b69ef5e08a 100644 --- a/src/Umbraco.Web/UmbracoHelper.cs +++ b/src/Umbraco.Web/UmbracoHelper.cs @@ -913,17 +913,19 @@ namespace Umbraco.Web /// Had to change to internal for testing. internal static bool ConvertIdObjectToInt(object id, out int intId) { - var s = id as string; - if (s != null) + if (id is string s) { return int.TryParse(s, out intId); } - if (id is int) + + if (id is int i) { - intId = (int)id; + intId = i; return true; } - intId = default(int); + + intId = default; + return false; }