From 39be73514c317e7d672e0a09862571e64f8979da Mon Sep 17 00:00:00 2001 From: Zufu Liu Date: Thu, 15 Jul 2021 17:29:24 +1000 Subject: Feature [feature-requests:#1370] Implement SCI_ALLOCATELINES to allocate indices to hold some number of lines. This is an optimization that can decrease reallocation overhead. --- src/Partitioning.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/Partitioning.h') diff --git a/src/Partitioning.h b/src/Partitioning.h index cf1bb6a7b..efa6bf95e 100644 --- a/src/Partitioning.h +++ b/src/Partitioning.h @@ -110,6 +110,11 @@ public: return static_cast(body->Length())-1; } + void ReAllocate(ptrdiff_t newSize) { + // + 1 accounts for initial element that is always 0. + body->ReAllocate(newSize + 1); + } + T Length() const noexcept { return PositionFromPartition(Partitions()); } -- cgit v1.2.3