X-Git-Url: http://git.osdn.net/view?p=fooeditengine%2FFooEditEngine.git;a=blobdiff_plain;f=Core%2FGapBuffer.cs;fp=Core%2FGapBuffer.cs;h=22941ce755e8305582bc534338620a718350fd4d;hp=e40b7c1a9be162e94f158edfa3b2f66deba9bdc0;hb=1b1fe1f2568c00d19bae47900ea1c8b318bf2784;hpb=da4cef68e92efd0bb5303524880856148f866697 diff --git a/Core/GapBuffer.cs b/Core/GapBuffer.cs index e40b7c1..22941ce 100644 --- a/Core/GapBuffer.cs +++ b/Core/GapBuffer.cs @@ -385,6 +385,18 @@ namespace Slusser.Collections.Generic } + /// + /// Allocate buffer + /// + /// more than zero + public void Allocate(int count) + { + if(count > this._gapEnd - this._gapStart) + { + Capacity = count + count; + } + } + /// /// Searches for the specified object and returns the zero-based index of the first /// occurrence within the .