System.Collections.Queue.TrimToSize C# (CSharp) Method

TrimToSize() public method

public TrimToSize ( ) : void
return void
        public virtual void TrimToSize()
        {
            SetCapacity(_size);
        }

Usage Example

Ejemplo n.º 1
0
            public override void execute3(RunTimeValueBase thisObj,FunctionDefine functionDefine,SLOT returnSlot,SourceToken token,StackFrame stackframe,out bool success)
            {
                System.Collections.Queue queue =
                    (System.Collections.Queue)((LinkObj <object>)((ASBinCode.rtData.rtObjectBase)thisObj).value).value;

                try
                {
                    queue.TrimToSize();
                    returnSlot.setValue(ASBinCode.rtData.rtUndefined.undefined);
                    success = true;
                }
                //catch (KeyNotFoundException)
                //{
                //    success = false;
                //    stackframe.throwAneException(token, arraylist.ToString() + "没有链接到脚本");
                //}
                catch (ArgumentException a)
                {
                    success = false;
                    stackframe.throwAneException(token,a.Message);
                }
                catch (IndexOutOfRangeException i)
                {
                    success = false;
                    stackframe.throwAneException(token,i.Message);
                }
            }
All Usage Examples Of System.Collections.Queue::TrimToSize