Skip to content
This repository was archived by the owner on Feb 10, 2024. It is now read-only.

Commit bc0f6d6

Browse files
committed
Modified the negative condition checks, removing the ! negation, replacing with an explicit false check.
This is a matter of coding style / personal preference, the C# compiler doesn't care, it's the same IL. I've come to feel that the explicit `false` check feels more semantic, (and in my old age, I've often missed the leading "!" - oops!)
1 parent c41fe86 commit bc0f6d6

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

src/Our.Umbraco.DocTypeGridEditor/Extensions/ViewEnginesCollectionExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public static bool ViewExists(
99
ControllerContext controllerContext,
1010
string viewName, bool isPartial = false)
1111
{
12-
var result = !isPartial
12+
var result = isPartial == false
1313
? viewEngines.FindView(controllerContext, viewName, null)
1414
: viewEngines.FindPartialView(controllerContext, viewName);
1515

src/Our.Umbraco.DocTypeGridEditor/PackageActions/AddObjectToJsonArray.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public bool Execute(string packageName, XmlNode xmlData)
4545
var trg = HttpContext.Current.Server.MapPath(GetTargetFileName(xmlData));
4646
var propKey = GetKeyProperty(xmlData);
4747

48-
if (!File.Exists(src) || !File.Exists(trg))
48+
if (File.Exists(src) == false || File.Exists(trg) == false)
4949
return false;
5050

5151
var srcJson = File.ReadAllText(src);

src/Our.Umbraco.DocTypeGridEditor/Web/Controllers/DocTypeGridEditorApiController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public object GetContentTypeIcon([ModelBinder] string contentTypeAlias)
5050
var contentType = Services.ContentTypeService.GetContentType(contentTypeAlias);
5151
return new
5252
{
53-
icon = contentType != null ? contentType.Icon : ""
53+
icon = contentType != null ? contentType.Icon : string.Empty
5454
};
5555
}
5656

src/Our.Umbraco.DocTypeGridEditor/Web/Controllers/DocTypeGridEditorSurfaceController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@ protected PartialViewResult CurrentPartialView(object model = null)
4949

5050
protected override PartialViewResult PartialView(string viewName, object model)
5151
{
52-
if (IsPreview && !string.IsNullOrWhiteSpace(PreviewViewPath))
52+
if (IsPreview && string.IsNullOrWhiteSpace(PreviewViewPath) == false)
5353
{
5454
var previewViewPath = GetFullViewPath(viewName, PreviewViewPath);
5555
if (ViewEngines.Engines.ViewExists(ControllerContext, previewViewPath, true))
5656
return base.PartialView(previewViewPath, model);
5757
}
5858

59-
if (!string.IsNullOrWhiteSpace(ViewPath))
59+
if (string.IsNullOrWhiteSpace(ViewPath) == false)
6060
{
6161
var viewPath = GetFullViewPath(viewName, ViewPath);
6262
if (ViewEngines.Engines.ViewExists(ControllerContext, viewPath, true))

src/Our.Umbraco.DocTypeGridEditor/Web/Helpers/SurfaceControllerHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public static bool SurfaceControllerExists(string controllerName, string actionN
6666

6767
public static bool SurfaceControllerExists(string name, string actionName = "Index", bool cacheResult = true)
6868
{
69-
if (!cacheResult)
69+
if (cacheResult == false)
7070
return SurfaceControllerExists(name, actionName);
7171

7272
return (bool)ApplicationContext.Current.ApplicationCache.RuntimeCache.GetCacheItem(

0 commit comments

Comments
 (0)