Skip to content

Commit 9a74a1b

Browse files
committed
condensing if statements
1 parent c416024 commit 9a74a1b

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/PowerShellEditorServices/Services/PowerShell/Refactoring/IterativeVariableVisitor.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -291,10 +291,8 @@ public void ProcessNode(Ast node)
291291
}
292292

293293
if (TargetFunction != null && commandParameterAst.Parent is CommandAst commandAst &&
294-
commandAst.GetCommandName().ToLower() == TargetFunction.Name.ToLower() && isParam)
294+
commandAst.GetCommandName().ToLower() == TargetFunction.Name.ToLower() && isParam && ShouldRename)
295295
{
296-
if (ShouldRename)
297-
{
298296
TextChange Change = new()
299297
{
300298
NewText = NewName.Contains("-") ? NewName : "-" + NewName,
@@ -303,9 +301,7 @@ public void ProcessNode(Ast node)
303301
EndLine = commandParameterAst.Extent.StartLineNumber - 1,
304302
EndColumn = commandParameterAst.Extent.StartColumnNumber + OldName.Length,
305303
};
306-
307304
Modifications.Add(Change);
308-
}
309305
}
310306
else
311307
{

0 commit comments

Comments
 (0)