Queue.TrimToSize 메서드
정의
public:
virtual void TrimToSize();
public virtual void TrimToSize ();
abstract member TrimToSize : unit -> unit
override this.TrimToSize : unit -> unit
Public Overridable Sub TrimToSize ()
예외
설명
이 메서드는 큐에 새 요소가 추가 될 경우 큐의 메모리 오버 헤드를 최소화할 데 사용할 수 있습니다.This method can be used to minimize a queue's memory overhead if no new elements will be added to the queue.
Queue를 초기 상태로 다시 설정 하려면 TrimToSize를 호출 하기 전에 Clear 메서드를 호출 합니다.To reset a Queue to its initial state, call the Clear method before calling TrimToSize. 빈 Queue을 잘라서 Queue의 용량을 기본 용량으로 설정 합니다.Trimming an empty Queue sets the capacity of the Queue to the default capacity.
이 메서드는 n Count되는 O(n) 작업입니다.This method is an O(n) operation, where n is Count.