-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Centralize ExcludeProperty filter application in ViewGenerator base class #26574
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
Changes from all commits
2e3d40a
63e05d9
0e53e55
ca18256
569f600
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,6 @@ | |
|
|
||
| using System.Collections; | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
| using System.Collections.ObjectModel; | ||
| using System.Management.Automation; | ||
| using System.Management.Automation.Internal; | ||
|
|
@@ -514,13 +513,8 @@ private void DisplayObject(PSObject so, TraversalInfo currentLevel, List<MshPara | |
| List<MshResolvedExpressionParameterAssociation> activeAssociationList = | ||
| AssociationManager.SetupActiveProperties(parameterList, so, _expressionFactory); | ||
|
|
||
| // Apply ExcludeProperty filter if specified | ||
| if (_parameters != null && _parameters.excludePropertyFilter != null) | ||
| { | ||
| activeAssociationList = activeAssociationList | ||
| .Where(item => !_parameters.excludePropertyFilter.IsMatch(item.ResolvedExpression)) | ||
| .ToList(); | ||
| } | ||
| // Apply ExcludeProperty filter using the centralized method | ||
| activeAssociationList = ViewGenerator.ApplyExcludeFilter(activeAssociationList, _parameters?.excludePropertyFilter); | ||
|
Comment on lines
+516
to
+517
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd expect we benefit from streaming here too. I mean something like - if we set arguments in constructor and SetupActiveProperties we can get filtered list with ActiveAssociationList property.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for the suggestion. Could you clarify the design you have in mind? I want to make sure I understand correctly. Currently, Are you suggesting to:
Also, replacing this recursive structure with an iterative approach using explicit stack might enable further streaming optimizations, but that would be a larger architectural change. Should I file a separate issue for that?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think it's worth it. It's better to spend time on something more useful.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for the feedback. I'll keep the current implementation. |
||
|
|
||
| // create a format entry | ||
| FormatEntry fe = new FormatEntry(); | ||
|
|
||
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.
Please replace
var-s with real type.