Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit c53a13c

Browse files
improve performance by avoiding the += to an array, for pipline
1 parent aa03e83 commit c53a13c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎Project_Move-ChildItemUp/Move-ChildItemUp.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ function Move-ChildItemUp {
4545

4646
# Before accepting pipeline input, initialize an array to collect folder paths
4747
begin {
48-
$folderPathsArray = @()
48+
$folderPathsArray = New-Object System.Collections.Generic.List[string]
4949
}
5050

5151
# Process pipeline input
5252
process {
53-
$folderPathsArray+=$folderPath
53+
$folderPathsArray.Add($folderPath)
5454
}
5555

5656
# After collecting all pipeline input, process the array

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /