From e41e95d37732bdb97ba6452591d8ae6d6ded5d95 Mon Sep 17 00:00:00 2001 From: Shannon Date: Thu, 16 Oct 2014 11:22:44 +1000 Subject: [PATCH] Instantly improves perf of content/media trees by updating the RecycleBinSmells methods - they were loading in ALL content that was in the bin before just to return a boolean! :( --- src/Umbraco.Core/Services/ContentServiceExtensions.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Core/Services/ContentServiceExtensions.cs b/src/Umbraco.Core/Services/ContentServiceExtensions.cs index 2e50873187..5180955542 100644 --- a/src/Umbraco.Core/Services/ContentServiceExtensions.cs +++ b/src/Umbraco.Core/Services/ContentServiceExtensions.cs @@ -11,7 +11,7 @@ namespace Umbraco.Core.Services /// public static bool RecycleBinSmells(this IContentService contentService) { - return contentService.GetContentInRecycleBin().Any(); + return contentService.CountChildren(Constants.System.RecycleBinContent) > 0; } /// @@ -21,7 +21,7 @@ namespace Umbraco.Core.Services /// public static bool RecycleBinSmells(this IMediaService mediaService) { - return mediaService.GetMediaInRecycleBin().Any(); + return mediaService.CountChildren(Constants.System.RecycleBinMedia) > 0; } } } \ No newline at end of file