From 93b2e4918f530267b7111d4e9d49a4bc485ec3a7 Mon Sep 17 00:00:00 2001 From: Tiberiu Chibici Date: Fri, 12 Sep 2014 19:22:21 +0300 Subject: [PATCH] Small optimization in icon provider --- RainmeterStudio/UI/Controller/IconProvider.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/RainmeterStudio/UI/Controller/IconProvider.cs b/RainmeterStudio/UI/Controller/IconProvider.cs index 1025985d..3fa09dc7 100644 --- a/RainmeterStudio/UI/Controller/IconProvider.cs +++ b/RainmeterStudio/UI/Controller/IconProvider.cs @@ -35,11 +35,13 @@ namespace RainmeterStudio.UI.Controller // Is a file? if (item.TargetKind == Reference.ReferenceTargetKind.File || item.TargetKind == Reference.ReferenceTargetKind.Project) { - if (String.IsNullOrEmpty(Path.GetExtension(item.StoragePath))) + var extension = Path.GetExtension(item.StoragePath); + + if (String.IsNullOrEmpty(extension)) key += "Unknown"; else - key += "_" + Path.GetExtension(item.StoragePath).Substring(1); + key += "_" + extension.Substring(1); } // Not a file, try to figure out if a directory