Skip to content

Inconsistent capacity handling in HeaderMap::with_capacity #353

Closed
@Qwaz

Description

@Qwaz

entries: Vec::with_capacity(raw_cap),

self.entries = Vec::with_capacity(usable_capacity(cap));

self.entries = Vec::with_capacity(usable_capacity(new_raw_cap));

HeaderMap::with_capacity reserves the entry vector with Vec::with_capacity(raw_cap), while other functions reserves the same entry with Vec::with_capacity(usable_capacity(raw_cap)).

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-headersArea: HTTP headersE-easyEffort: easy. Start here :DS-performanceSeverity: performance. Make existing functionality go faster.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions