OSDN Git Service

ファイルロードを高速化した
[fooeditengine/FooEditEngine.git] / Core / GapBuffer.cs
index e40b7c1..22941ce 100644 (file)
@@ -385,6 +385,18 @@ namespace Slusser.Collections.Generic
                }
 
 
+        /// <summary>
+        /// Allocate buffer
+        /// </summary>
+        /// <param name="count">more than zero</param>
+        public void Allocate(int count)
+        {
+            if(count > this._gapEnd - this._gapStart)
+            {
+                Capacity = count + count;
+            }
+        }
+
                /// <summary>
                /// Searches for the specified object and returns the zero-based index of the first 
                /// occurrence within the <see cref="GapBuffer{T}"/>.