From e3895a4c43bacaf43a1e2c35c2391bfb3820bd2b Mon Sep 17 00:00:00 2001 From: Sebastian Date: Sat, 30 May 2020 17:52:04 +0200 Subject: [PATCH] Minor performance improvement around rule formatter. --- .../HandleRules/RuleEventFormatter.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/RuleEventFormatter.cs b/backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/RuleEventFormatter.cs index c10dad1f6..d34f0492e 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/RuleEventFormatter.cs +++ b/backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/RuleEventFormatter.cs @@ -107,7 +107,10 @@ namespace Squidex.Domain.Apps.Core.HandleRules var parts = BuildParts(text, @event); - await ValueTaskEx.WhenAll(parts.Select(x => x.Var)); + if (parts.Any(x => !x.Var.IsCompleted)) + { + await ValueTaskEx.WhenAll(parts.Select(x => x.Var)); + } return CombineParts(text, parts); }