FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

WebCmdlets: WebResponseObject.CoreClr.cs every get on Headers creates a new Dictionary · Issue #3842 · PowerShell/PowerShell · GitHub

WebCmdlets: WebResponseObject.CoreClr.cs every get on Headers creates a new Dictionary #3842

Description

The Headers property creates a new Dictionary which then gets populated. Users typically do something like

if (obj.Headers.ContainsKey("Something"))
{
    obj.Headers["Something"] ...
}

which now instantiates a new Dictionary twice, we should optimize this code. consider using a ReadOnlyDictionary

Metadata

Metadata

Assignees

No one assigned

    Labels

    WG-Cmdletsgeneral cmdlet issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


    Back | FazBrowse Home | New Git URL