Skip to content

Commit

Permalink
refactor(sln): change "" constants to string.Empty
Browse files Browse the repository at this point in the history
  • Loading branch information
bkapustik committed Aug 26, 2024
1 parent f0b9df7 commit 2d309c2
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions examples/DancingGoat/Search/Services/WebCrawlerService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public async Task<string> CrawlWebPage(IWebPageFieldsSource page)
ex,
$"Tree Path: {page.SystemFields.WebPageItemTreePath}");
}
return "";
return string.Empty;
}

public async Task<string> CrawlPage(string url)
Expand All @@ -61,6 +61,6 @@ public async Task<string> CrawlPage(string url)
ex,
$"Url: {url}");
}
return "";
return string.Empty;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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(
" ",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public override IndexSettings GetAlgoliaIndexSettings() =>
{
var result = new List<JObject>();

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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public async Task<ICommandResponse<RowActionResult>> 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));
}
Expand Down

0 comments on commit 2d309c2

Please sign in to comment.