From 2d309c2c1f9c0bba9446a1f4a8328ed3b7dc0518 Mon Sep 17 00:00:00 2001 From: bkapustik <82807109+bkapustik@users.noreply.github.com> Date: Mon, 26 Aug 2024 12:01:10 +0200 Subject: [PATCH] refactor(sln): change "" constants to string.Empty --- examples/DancingGoat/Search/Services/WebCrawlerService.cs | 4 ++-- .../DancingGoat/Search/Services/WebScraperHtmlSanitizer.cs | 4 ++-- examples/DancingGoat/Search/SimpleSearchIndexingStrategy.cs | 2 +- .../Admin/UIPages/IndexListingPage.cs | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/DancingGoat/Search/Services/WebCrawlerService.cs b/examples/DancingGoat/Search/Services/WebCrawlerService.cs index c4af3e5..133d948 100644 --- a/examples/DancingGoat/Search/Services/WebCrawlerService.cs +++ b/examples/DancingGoat/Search/Services/WebCrawlerService.cs @@ -43,7 +43,7 @@ public async Task CrawlWebPage(IWebPageFieldsSource page) ex, $"Tree Path: {page.SystemFields.WebPageItemTreePath}"); } - return ""; + return string.Empty; } public async Task CrawlPage(string url) @@ -61,6 +61,6 @@ public async Task CrawlPage(string url) ex, $"Url: {url}"); } - return ""; + return string.Empty; } } diff --git a/examples/DancingGoat/Search/Services/WebScraperHtmlSanitizer.cs b/examples/DancingGoat/Search/Services/WebScraperHtmlSanitizer.cs index da935d6..473e19e 100644 --- a/examples/DancingGoat/Search/Services/WebScraperHtmlSanitizer.cs +++ b/examples/DancingGoat/Search/Services/WebScraperHtmlSanitizer.cs @@ -53,8 +53,8 @@ public virtual string SanitizeHtmlDocument(string htmlContent) textContent = HTMLHelper.RegexHtmlToTextWhiteSpace.Replace(textContent, " "); textContent = textContent.Trim(); - string title = doc.Head?.QuerySelector("title")?.TextContent ?? ""; - string description = doc.Head?.QuerySelector("meta[name='description']")?.GetAttribute("content") ?? ""; + string title = doc.Head?.QuerySelector("title")?.TextContent ?? string.Empty; + string description = doc.Head?.QuerySelector("meta[name='description']")?.GetAttribute("content") ?? string.Empty; return string.Join( " ", diff --git a/examples/DancingGoat/Search/SimpleSearchIndexingStrategy.cs b/examples/DancingGoat/Search/SimpleSearchIndexingStrategy.cs index 4631cb3..2f33fac 100644 --- a/examples/DancingGoat/Search/SimpleSearchIndexingStrategy.cs +++ b/examples/DancingGoat/Search/SimpleSearchIndexingStrategy.cs @@ -36,7 +36,7 @@ public override IndexSettings GetAlgoliaIndexSettings() => { var result = new List(); - string title = ""; + string title = string.Empty; // IIndexEventItemModel could be a reusable content item or a web page item, so we use // pattern matching to get access to the web page item specific type and fields diff --git a/src/Kentico.Xperience.Algolia/Admin/UIPages/IndexListingPage.cs b/src/Kentico.Xperience.Algolia/Admin/UIPages/IndexListingPage.cs index f2fe0ea..ca4452b 100644 --- a/src/Kentico.Xperience.Algolia/Admin/UIPages/IndexListingPage.cs +++ b/src/Kentico.Xperience.Algolia/Admin/UIPages/IndexListingPage.cs @@ -149,7 +149,7 @@ public async Task> Rebuild(int id, Cancellatio int indexID = conversionService.GetInteger(row.Identifier, 0); string indexName = AlgoliaIndexStore.Instance.GetIndex(indexID) is AlgoliaIndex index ? index.IndexName - : ""; + : string.Empty; return statistics.FirstOrDefault(s => string.Equals(s.Name, indexName, StringComparison.OrdinalIgnoreCase)); }