Instance Method インスタンスメソッド

removeAll(keepingCapacity:)

Removes all elements from the collection. 全ての要素をコレクションから除去します。

Declaration 宣言

mutating func removeAll(keepingCapacity keepCapacity: Bool = false)

Parameters パラメータ

keepCapacity

Pass true to request that the collection avoid releasing its storage. Retaining the collection’s storage can be a useful optimization when you’re planning to grow the collection again. The default value is false. trueを渡して、コレクションがそのストレージを解放するのを回避するよう要求してください。コレクションのストレージを保持することは、あなたがコレクションをもう一度増大しようと計画している時に、ひとつの有益な最適化であることができます。省略時の値はfalseです。

Discussion 議論

Calling this method may invalidate any existing indices for use with this collection. このメソッドを呼び出すことは、このコレクションで使うためのあらゆる既存のインデックスを無効にします。

Complexity: O(n), where n is the length of the collection. 計算量:O(n)、ここでnはコレクションの長さです。

See Also 参照

Removing Bytes バイトの削除