From 8c267645bf52d152e9052eddde8dc3b9406e7267 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Sat, 31 Dec 2022 13:25:00 +1100 Subject: [PATCH] Update tidwall/btree --- go.mod | 2 +- go.sum | 4 ++-- request-strategy/tidwall-btree.go | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 29d79a7e..1c532213 100644 --- a/go.mod +++ b/go.mod @@ -43,7 +43,7 @@ require ( github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.12.2 github.com/stretchr/testify v1.8.0 - github.com/tidwall/btree v1.3.1 + github.com/tidwall/btree v1.6.0 go.etcd.io/bbolt v1.3.6 go.opentelemetry.io/otel v1.8.0 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.8.0 diff --git a/go.sum b/go.sum index 88f91cf1..75799c5a 100644 --- a/go.sum +++ b/go.sum @@ -475,8 +475,8 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/tidwall/btree v1.3.1 h1:636+tdVDs8Hjcf35Di260W2xCW4KuoXOKyk9QWOvCpA= -github.com/tidwall/btree v1.3.1/go.mod h1:LGm8L/DZjPLmeWGjv5kFrY8dL4uVhMmzmmLYmsObdKE= +github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg= +github.com/tidwall/btree v1.6.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= github.com/tinylib/msgp v1.0.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= github.com/tinylib/msgp v1.1.0/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= github.com/tinylib/msgp v1.1.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= diff --git a/request-strategy/tidwall-btree.go b/request-strategy/tidwall-btree.go index 6d786ce2..6b84dc05 100644 --- a/request-strategy/tidwall-btree.go +++ b/request-strategy/tidwall-btree.go @@ -5,7 +5,7 @@ import ( ) type tidwallBtree struct { - tree *btree.Generic[pieceRequestOrderItem] + tree *btree.BTreeG[pieceRequestOrderItem] PathHint *btree.PathHint } @@ -15,11 +15,11 @@ func (me *tidwallBtree) Scan(f func(pieceRequestOrderItem) bool) { func NewTidwallBtree() *tidwallBtree { return &tidwallBtree{ - tree: btree.NewGenericOptions( + tree: btree.NewBTreeGOptions( func(a, b pieceRequestOrderItem) bool { return a.Less(&b) }, - btree.Options{NoLocks: true}), + btree.Options{NoLocks: true, Degree: 64}), } }