From d822225465f192473aaebf150c7cb9b00f5baca3 Mon Sep 17 00:00:00 2001 From: sbwalker Date: Wed, 17 Jul 2024 16:22:01 -0400 Subject: [PATCH] use Task.FromResult() --- Oqtane.Server/Modules/Admin/Files/Manager/FileManager.cs | 8 ++------ Oqtane.Server/Modules/HtmlText/Manager/HtmlTextManager.cs | 6 ++---- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/Oqtane.Server/Modules/Admin/Files/Manager/FileManager.cs b/Oqtane.Server/Modules/Admin/Files/Manager/FileManager.cs index 2f600b3a6..03926ea8a 100644 --- a/Oqtane.Server/Modules/Admin/Files/Manager/FileManager.cs +++ b/Oqtane.Server/Modules/Admin/Files/Manager/FileManager.cs @@ -1,6 +1,5 @@ using Oqtane.Models; using Oqtane.Repository; -using Oqtane.Documentation; using Oqtane.Interfaces; using System.Collections.Generic; using System; @@ -22,10 +21,8 @@ public FileManager(IFolderRepository folderRepository, IFileRepository fileRepos _fileRepository = fileRepository; } - public async Task> GetSearchContentsAsync(PageModule pageModule, DateTime lastIndexedOn) + public Task> GetSearchContentsAsync(PageModule pageModule, DateTime lastIndexedOn) { - await Task.CompletedTask; - var searchContents = new List(); var folders = _folderRepository.GetFolders(pageModule.Module.SiteId); @@ -72,11 +69,10 @@ public async Task> GetSearchContentsAsync(PageModule pageMod }; searchContents.Add(searchContent); } - } } - return searchContents; + return Task.FromResult(searchContents); } } } diff --git a/Oqtane.Server/Modules/HtmlText/Manager/HtmlTextManager.cs b/Oqtane.Server/Modules/HtmlText/Manager/HtmlTextManager.cs index d0a9f3025..744fb7b5b 100644 --- a/Oqtane.Server/Modules/HtmlText/Manager/HtmlTextManager.cs +++ b/Oqtane.Server/Modules/HtmlText/Manager/HtmlTextManager.cs @@ -49,10 +49,8 @@ public string ExportModule(Module module) return content; } - public async Task> GetSearchContentsAsync(PageModule pageModule, DateTime lastIndexedOn) + public Task> GetSearchContentsAsync(PageModule pageModule, DateTime lastIndexedOn) { - await Task.CompletedTask; - var searchContents = new List(); var htmltexts = _htmlText.GetHtmlTexts(pageModule.ModuleId); @@ -72,7 +70,7 @@ public async Task> GetSearchContentsAsync(PageModule pageMod } } - return searchContents; + return Task.FromResult(searchContents); } public void ImportModule(Module module, string content, string version)