diff --git a/frame_sorter.go b/frame_sorter.go index f0d3c9c85c3..5632536505d 100644 --- a/frame_sorter.go +++ b/frame_sorter.go @@ -2,6 +2,7 @@ package quic import ( "errors" + "github.com/lucas-clemente/quic-go/internal/utils/tree" "github.com/lucas-clemente/quic-go/internal/protocol" diff --git a/frame_sorter_test.go b/frame_sorter_test.go index de23f3a5d39..3fcdc7cfe7b 100644 --- a/frame_sorter_test.go +++ b/frame_sorter_test.go @@ -3,11 +3,12 @@ package quic import ( "bytes" "fmt" - "github.com/lucas-clemente/quic-go/internal/utils/tree" "math" "math/rand" "time" + "github.com/lucas-clemente/quic-go/internal/utils/tree" + "github.com/lucas-clemente/quic-go/internal/protocol" "github.com/lucas-clemente/quic-go/internal/utils" . "github.com/onsi/ginkgo" diff --git a/internal/utils/streamframe_interval.go b/internal/utils/streamframe_interval.go index fbe3ad4456e..b52e61d8d0b 100644 --- a/internal/utils/streamframe_interval.go +++ b/internal/utils/streamframe_interval.go @@ -2,6 +2,7 @@ package utils import ( "fmt" + "github.com/lucas-clemente/quic-go/internal/protocol" "github.com/lucas-clemente/quic-go/internal/utils/tree" ) diff --git a/internal/utils/tree/tree.go b/internal/utils/tree/tree.go index 72780a6f7b3..54ff10c435b 100644 --- a/internal/utils/tree/tree.go +++ b/internal/utils/tree/tree.go @@ -50,13 +50,6 @@ func (t *Btree) NotEmpty() bool { return t.root != nil } -func (t *Btree) balance() int8 { - if t.root != nil { - return balance(t.root) - } - return 0 -} - // Insert inserts a new value into the tree and returns the tree pointer func (t *Btree) Insert(value Val) *Btree { added := false @@ -170,7 +163,7 @@ func (t *Btree) Head() Val { if t.root == nil { return nil } - var beginning = t.root + beginning := t.root for beginning.left != nil { beginning = beginning.left } @@ -190,7 +183,7 @@ func (t *Btree) Tail() Val { if t.root == nil { return nil } - var beginning = t.root + beginning := t.root for beginning.right != nil { beginning = beginning.right } @@ -265,7 +258,7 @@ func deleteNode(n *Node, value Val, deleted *bool) *Node { *deleted = true } - //re-balance + // re-balance if n == nil { return n }