IDictionary -> IDictionary<string, FunctionInfo> for FunctionTable#12658
Merged
3 commits merged intoPowerShell:masterfrom May 20, 2020
Merged
IDictionary -> IDictionary<string, FunctionInfo> for FunctionTable#126583 commits merged intoPowerShell:masterfrom
3 commits merged intoPowerShell:masterfrom
Conversation
f63aa7f to
6667d89
Compare
iSazonov
reviewed
May 14, 2020
| WildcardOptions.IgnoreCase); | ||
|
|
||
| foreach (DictionaryEntry functionEntry in _context.EngineSessionState.GetFunctionTable()) | ||
| foreach (var functionEntry in _context.EngineSessionState.GetFunctionTable()) |
Collaborator
There was a problem hiding this comment.
The type is not obvious. Please replace var with explicit type.
Collaborator
Author
There was a problem hiding this comment.
Maybe
ExecutionContext context = _context;
SessionStateInternal sessionState = context.EngineSessionState;
IDictionary<string, FunctionInfo> functionTable = sessionState.GetFunctionTable();
foreach (KeyValuePair<string, FunctionInfo> functionEntry in functionTable)
{
...The types are not obvious in _context.EngineSessionState.GetFunctionTable() either...
Collaborator
There was a problem hiding this comment.
_context.EngineSessionState is common pattern in Engine. .For the small refactor I thing it makes sense only replace var with type.
src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs
Outdated
Show resolved
Hide resolved
Collaborator
Author
|
Codacy is just wrong here, by the way. |
iSazonov
approved these changes
May 20, 2020
|
Hello @iSazonov! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
|
🎉 Handy links: |
This pull request was closed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Summary
Typed return value for SessionStateInternal.GetFunctionTable.
IDictionary<string, FunctionInfo> instead of IDictionary.
PR Context
Removes unnecessary casts, and helps with later nullablility changes.
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.