Skip to content

Commit 7592316

Browse files
committed
Fix RCS1124
1 parent 7a0a824 commit 7592316

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

dotnet/src/Microsoft.Agents.AI.Purview/ScopedContentProcessor.cs

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -242,22 +242,16 @@ private async Task<ProcessContentResponse> ProcessContentWithProtectionScopesAsy
242242
/// </summary>
243243
/// <param name="pcResponse">The process content response which may contain DLP actions.</param>
244244
/// <param name="actionInfos">DLP actions returned from protection scopes.</param>
245-
/// <returns>The process content response with the protection scopes DLP actions added. Actions are deduplicated.</returns>
245+
/// <returns>The process content response with the protection scopes DLP actions added.</returns>
246246
private static ProcessContentResponse CombinePolicyActions(ProcessContentResponse pcResponse, List<DlpActionInfo>? actionInfos)
247247
{
248-
if (actionInfos == null || actionInfos.Count == 0)
248+
if (actionInfos?.Count > 0)
249249
{
250-
return pcResponse;
251-
}
252-
253-
if (pcResponse.PolicyActions == null)
254-
{
255-
pcResponse.PolicyActions = actionInfos;
256-
return pcResponse;
250+
pcResponse.PolicyActions = pcResponse.PolicyActions is null ?
251+
actionInfos :
252+
[.. pcResponse.PolicyActions, .. actionInfos];
257253
}
258254

259-
List<DlpActionInfo> pcActionInfos = [.. pcResponse.PolicyActions, .. actionInfos];
260-
pcResponse.PolicyActions = pcActionInfos;
261255
return pcResponse;
262256
}
263257

0 commit comments

Comments
 (0)