aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/corpus/fenwik.go
diff options
context:
space:
mode:
authorGrigory Bazilevich <g.bazilevich@ispras.ru>2026-03-11 09:44:38 +0300
committerGrigory Bazilevich <g.bazilevich@ispras.ru>2026-03-11 09:44:38 +0300
commit3fe1aeddbc74e43e8561db61cdaad620c5993d92 (patch)
tree5110374b616f67a69c5e6161ff56afabec35ce7d /pkg/corpus/fenwik.go
parenta68fda52c366653ed73c240a6b9c3f4e750ccdfd (diff)
pkg/corpus: upgrade corpus minimization algorithm
Diffstat (limited to 'pkg/corpus/fenwik.go')
-rw-r--r--pkg/corpus/fenwik.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/corpus/fenwik.go b/pkg/corpus/fenwik.go
index 3a49219ac..dd6bfdbef 100644
--- a/pkg/corpus/fenwik.go
+++ b/pkg/corpus/fenwik.go
@@ -43,6 +43,11 @@ func (t *fenwikTree) prefixSumTo(ind int) (sum int64) {
return
}
+func (t *fenwikTree) reserve(cap int) {
+ t.capacity = cap
+ t.extendAndRebuild()
+}
+
func (t *fenwikTree) extendAndRebuild() {
if t.capacity == 0 {
t.capacity = 16