docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Method EnsureCapacity

    EnsureCapacity<T>(List<T>, int)

    Ensures that the capacity of this list is at least as large the given value.

    Declaration
    public static void EnsureCapacity<T>(this List<T> list, int capacity)
    Parameters
    Type Name Description
    List<T> list

    The list whose capacity will be ensured.

    int capacity

    The minimum number of elements the list storage must contain.

    Type Parameters
    Name Description
    T

    The list element type.

    Remarks

    Increases the capacity of the list, if necessary, but doe not decrease the capacity if it already exceeds the specified value.

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)