From f33fd58aadb661ef7c7a1ca58caf4adf397ffe6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C4=81ris=20Krivte=C5=BEs?= Date: Thu, 27 Jul 2023 13:32:00 +0300 Subject: [PATCH] Cleanup. --- .../Services/DefaultUriAugmenterService.cs | 4 ++-- src/Geta.Optimizely.Sitemaps/XML/SitemapXmlGenerator.cs | 9 ++------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/Geta.Optimizely.Sitemaps/Services/DefaultUriAugmenterService.cs b/src/Geta.Optimizely.Sitemaps/Services/DefaultUriAugmenterService.cs index abfeb84..51cb5c2 100644 --- a/src/Geta.Optimizely.Sitemaps/Services/DefaultUriAugmenterService.cs +++ b/src/Geta.Optimizely.Sitemaps/Services/DefaultUriAugmenterService.cs @@ -7,9 +7,9 @@ namespace Geta.Optimizely.Sitemaps.Services { public class DefaultUriAugmenterService : IUriAugmenterService { - public IEnumerable GetAugmentUris(IContent content, CurrentLanguageContent languageContentInfo, Uri fullUri) + public IEnumerable GetAugmentUris(IContent content, CurrentLanguageContent languageContentInfo, Uri originUri) { - yield return fullUri; + yield return originUri; } } } diff --git a/src/Geta.Optimizely.Sitemaps/XML/SitemapXmlGenerator.cs b/src/Geta.Optimizely.Sitemaps/XML/SitemapXmlGenerator.cs index f58e07c..d58f38f 100644 --- a/src/Geta.Optimizely.Sitemaps/XML/SitemapXmlGenerator.cs +++ b/src/Geta.Optimizely.Sitemaps/XML/SitemapXmlGenerator.cs @@ -57,7 +57,7 @@ public abstract class SitemapXmlGenerator : ISitemapXmlGenerator public bool IsDebugMode { get; set; } - private readonly Regex _dashRegex = new Regex("[-]+", RegexOptions.Compiled); + private readonly Regex _dashRegex = new("[-]+", RegexOptions.Compiled, TimeSpan.FromMilliseconds(100)); protected SitemapXmlGenerator( ISitemapRepository sitemapRepository, @@ -193,12 +193,7 @@ protected virtual IEnumerable GenerateXmlElements(IEnumerable(); } - if (TryGet(contentReference, out _)) - { - continue; - } - - if (ContentReference.IsNullOrEmpty(contentReference)) + if (ContentReference.IsNullOrEmpty(contentReference) || TryGet(contentReference, out _)) { continue; }