-
Notifications
You must be signed in to change notification settings - Fork 7.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove redundant local assignment in AclCommands #14358
Conversation
Follow-up to PowerShell#14341.
@PoshChan please remind me in 1 day |
@@ -528,7 +525,7 @@ public static string[] GetAllCentralAccessPolicies(PSObject instance) | |||
|
|||
// Add CAP names and IDs to a string array. | |||
string[] policies = new string[capCount]; | |||
NativeMethods.CENTRAL_ACCESS_POLICY cap = new NativeMethods.CENTRAL_ACCESS_POLICY(); | |||
NativeMethods.CENTRAL_ACCESS_POLICY cap; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can be removed here and instead be defined in the for loop body scope, where it is only used (similar to pCapId)/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, this code is inside of an if !CORECLR
do you still want the change made?
@@ -1144,7 +1141,7 @@ private IntPtr GetSaclWithCapId(string capStr) | |||
} | |||
|
|||
// Find the supplied string among available CAP names, use the corresponding CAPID. | |||
NativeMethods.CENTRAL_ACCESS_POLICY cap = new NativeMethods.CENTRAL_ACCESS_POLICY(); | |||
NativeMethods.CENTRAL_ACCESS_POLICY cap; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can be removed here and instead be defined in the for loop body scope, where it is only used.
Addrees @PaulHigin review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@PaulHigin I've pushed some more changes on the same theme. |
@PoshChan please remind me in 20 hours |
@rjmholt, this is the reminder you requested 20 hours ago |
@rjmholt, this is the reminder you requested 1 day ago |
🎉 Handy links: |
Follow-up to #14341.