mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-29 22:29:56 +02:00
all: Run modernize -fix ./...
This commit is contained in:
@@ -193,7 +193,7 @@ func TestTreePara(t *testing.T) {
|
||||
},
|
||||
)
|
||||
|
||||
for i := 0; i < 8; i++ {
|
||||
for i := range 8 {
|
||||
i := i
|
||||
r.Run(func() error {
|
||||
a := &testValue{ID: "/a"}
|
||||
@@ -289,7 +289,7 @@ func BenchmarkTreeInsert(b *testing.B) {
|
||||
},
|
||||
)
|
||||
|
||||
for i := 0; i < numElements; i++ {
|
||||
for i := range numElements {
|
||||
lang := rand.Intn(2)
|
||||
tree.InsertIntoValuesDimension(fmt.Sprintf("/%d", i), &testValue{ID: fmt.Sprintf("/%d", i), Lang: lang, Weight: i, NoCopy: true})
|
||||
}
|
||||
@@ -323,7 +323,7 @@ func BenchmarkWalk(b *testing.B) {
|
||||
},
|
||||
)
|
||||
|
||||
for i := 0; i < numElements; i++ {
|
||||
for i := range numElements {
|
||||
lang := rand.Intn(2)
|
||||
tree.InsertIntoValuesDimension(fmt.Sprintf("/%d", i), &testValue{ID: fmt.Sprintf("/%d", i), Lang: lang, Weight: i, NoCopy: true})
|
||||
}
|
||||
@@ -355,8 +355,8 @@ func BenchmarkWalk(b *testing.B) {
|
||||
base := createTree()
|
||||
b.ResetTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
for d1 := 0; d1 < 1; d1++ {
|
||||
for d2 := 0; d2 < 2; d2++ {
|
||||
for d1 := range 1 {
|
||||
for d2 := range 2 {
|
||||
tree := base.Shape(d1, d2)
|
||||
w := &doctree.NodeShiftTreeWalker[*testValue]{
|
||||
Tree: tree,
|
||||
|
@@ -363,7 +363,7 @@ func (r *NodeShiftTreeWalker[T]) Walk(ctx context.Context) error {
|
||||
main := r.Tree
|
||||
|
||||
var err error
|
||||
fnMain := func(s string, v interface{}) bool {
|
||||
fnMain := func(s string, v any) bool {
|
||||
if r.ShouldSkip(s) {
|
||||
return false
|
||||
}
|
||||
|
@@ -34,7 +34,7 @@ func NewTreeShiftTree[T comparable](d, length int) *TreeShiftTree[T] {
|
||||
panic("length must be > 0")
|
||||
}
|
||||
trees := make([]*SimpleTree[T], length)
|
||||
for i := 0; i < length; i++ {
|
||||
for i := range length {
|
||||
trees[i] = NewSimpleTree[T]()
|
||||
}
|
||||
return &TreeShiftTree[T]{d: d, trees: trees}
|
||||
|
Reference in New Issue
Block a user