From b9091a7889bf53ff9f2d642c53ab52abe30a71a6 Mon Sep 17 00:00:00 2001 From: Lombiq Date: Tue, 24 Nov 2015 21:00:34 +0100 Subject: [PATCH] Removing unnecessary if when creating shape alternates --- src/Orchard.Web/Modules/Orchard.Widgets/Shapes.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/Orchard.Web/Modules/Orchard.Widgets/Shapes.cs b/src/Orchard.Web/Modules/Orchard.Widgets/Shapes.cs index 8108f3c95..4287421b2 100644 --- a/src/Orchard.Web/Modules/Orchard.Widgets/Shapes.cs +++ b/src/Orchard.Web/Modules/Orchard.Widgets/Shapes.cs @@ -39,12 +39,8 @@ namespace Orchard.Widgets { widget.Classes.Add("widget-" + widgetPart.Name); // Widget__Name__[Name] - if (widgetPart.Name.Contains("-")) { - displaying.ShapeMetadata.Alternates.Add("Widget__Name__" + widgetPart.Name.Replace("-", "__")); - } - else { - displaying.ShapeMetadata.Alternates.Add("Widget__Name__" + widgetPart.Name); - } + // Replacing dashes to shape type-compatible double underscores. + displaying.ShapeMetadata.Alternates.Add("Widget__Name__" + widgetPart.Name.Replace("-", "__")); } }