Skip to content

Commit 75bd643

Browse files
committed
Post go fix
1 parent c489a2a commit 75bd643

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

binary.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ type Binary struct {
1212
func NewBinary(width, height int, seed int64, perc float64) *Binary {
1313
lr := rand.New(rand.NewSource(seed))
1414
ba := make([][]bool, height)
15-
for i := 0; i < height; i++ {
15+
for i := range height {
1616
ba[i] = make([]bool, width)
17-
for j := 0; j < width; j++ {
17+
for j := range width {
1818
ba[i][j] = lr.Float64() < perc
1919
}
2020
}

blocks.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ func (bn *BlockNoise) cbCache(r, c, samps int, w, h float64) [][]float64 {
138138
func (bn *BlockNoise) cellBlocks(r, c, samps int, w, h float64) [][]float64 {
139139
lr := rand.New(rand.NewSource(bn.Seed + int64(r*bn.Cols+c)))
140140
res := make([][]float64, samps)
141-
for i := 0; i < samps; i++ {
141+
for i := range samps {
142142
ox, oy := lr.Float64()*bn.CellW, lr.Float64()*bn.CellH
143143
dx, dy := lr.Float64()*w, lr.Float64()*h
144144
v := lr.Float64()*2 - 1

fractal.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ type VariableFractal struct {
5959
func NewVariableFractal(src Field, xfm *g2d.Aff3, comb OctaveCombiner, octsrc Field, scale float64) *VariableFractal {
6060
n := int(scale)
6161
w := make([]float64, n)
62-
for i := 0; i < n; i++ {
62+
for i := range n {
6363
w[i] = 1
6464
}
6565
return &VariableFractal{"VariableFractal", src, xfm, comb, octsrc, scale / 2, w}
@@ -106,7 +106,7 @@ func NewFBM(hurst, lacunarity float64, maxoct int) *FBM {
106106
// combines them using the precomputed weights.
107107
func (f *FBM) Combine(values ...float64) float64 {
108108
res := 0.0
109-
for i := 0; i < len(values); i++ {
109+
for i := range values {
110110
res += values[i] * f.Weights[i]
111111
}
112112
return res
@@ -133,7 +133,7 @@ func NewMF(hurst, lacunarity, offset float64, maxoct int) *MF {
133133
// combines them using the precomputed weights and offset.
134134
func (f *MF) Combine(values ...float64) float64 {
135135
res := 0.0
136-
for i := 0; i < len(values); i++ {
136+
for i := range values {
137137
res += (values[i] + f.Offset) * f.Weights[i]
138138
}
139139
return res

0 commit comments

Comments
 (0)