Skip to content

Queue<T>: why set GrowFactor to 200 and divide by 100? #28761

@chukunx

Description

@chukunx

hi guys, this isn't an issue, but just me being curious about a configuration setup in Queue<T> class. may i ask why do we want to double the size of array by initiating the GrowFactor as 200 and multiplying the original size by GrowFactor / 100 here? what's the downside of using 2 directly? thanks.
https://github.com/dotnet/corefx/blob/bca44089343cf14cffd3cb0982b7e209692f6731/src/System.Collections/src/System/Collections/Generic/Queue.cs#L188

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-System.CollectionsquestionAnswer questions and provide assistance, not an issue with source code or documentation.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions