From a1c335b4c0a586ae145e56cf777c107437b85804 Mon Sep 17 00:00:00 2001 From: rvazarkar Date: Fri, 19 Jan 2024 11:42:58 -0500 Subject: [PATCH] chore: refactor nested if --- src/Runtime/CollectionTask.cs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/Runtime/CollectionTask.cs b/src/Runtime/CollectionTask.cs index e4403ee..5bb57ff 100644 --- a/src/Runtime/CollectionTask.cs +++ b/src/Runtime/CollectionTask.cs @@ -84,17 +84,15 @@ internal async Task StartCollection() foreach (var wkp in _context.LDAPUtils.GetWellKnownPrincipalOutput(_context.DomainName)) { - if (wkp.ObjectIdentifier.EndsWith(EnterpriseDCSuffix)) + if (!wkp.ObjectIdentifier.EndsWith(EnterpriseDCSuffix)) { - if (wkp is Group g && g.Members.Length == 0) - { - continue; - } + wkp.Properties["reconcile"] = false; } - else + else if (wkp is Group g && g.Members.Length == 0) { - wkp.Properties["reconcile"] = false; + continue; } + await _outputChannel.Writer.WriteAsync(wkp); }