Skip to content

Commit 9decc06

Browse files
Further simplified logic
1 parent 7adc53a commit 9decc06

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

ProtectionScan/Features/MainFeature.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -291,10 +291,9 @@ private void WriteProtectionResultJson(string path, Dictionary<string, List<stri
291291
// Adds the non-leaf-node protections back in
292292
for (int i = 0; i < modifyNodeList.Count; i++)
293293
{
294-
var modifyNode = modifyNodeList[i].Item1[modifyNodeList[i].Item2];
295-
var copyDictionary = new Dictionary<string, object>((Dictionary<string, object>)modifyNode);
296-
modifyNode = new List<object>();
297-
if (modifyNode is not List<object> modifyThisNode) continue;
294+
var copyDictionary = modifyNodeList[i].Item1[modifyNodeList[i].Item2];
295+
modifyNodeList[i].Item1[modifyNodeList[i].Item2] = new List<object>();
296+
if (modifyNodeList[i].Item1[modifyNodeList[i].Item2] is not List<object> modifyThisNode) continue;
298297
modifyThisNode.Add(modifyNodeList[i].Item3);
299298
modifyThisNode.Add(copyDictionary);
300299
}

0 commit comments

Comments
 (0)