Skip to content

Commit d6b7bec

Browse files
authored
fix: prefer range over int vs for loop (#1047)
Signed-off-by: Chris Gianelloni <[email protected]>
1 parent c7d8267 commit d6b7bec

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ledger/alonzo/pparams_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,12 @@ func TestAlonzoProtocolParamsUpdate(t *testing.T) {
132132
func TestAlonzoProtocolParametersUpdateFromGenesis(t *testing.T) {
133133
// Create cost models with numeric string keys
134134
plutusV1CostModel := make(map[string]int)
135-
for i := 0; i < 166; i++ {
135+
for i := range 166 {
136136
plutusV1CostModel[strconv.Itoa(i)] = i + 1 // "0":1, "1":2, etc.
137137
}
138138

139139
plutusV2CostModel := make(map[string]int)
140-
for i := 0; i < 175; i++ {
140+
for i := range 175 {
141141
plutusV2CostModel[strconv.Itoa(i)] = i + 1 // "0":1, "1":2, etc.
142142
}
143143

@@ -185,7 +185,7 @@ func TestAlonzoProtocolParametersUpdateFromGenesis(t *testing.T) {
185185
func TestCostModelArrayFormat(t *testing.T) {
186186
// Create cost model with numeric string keys
187187
plutusV1CostModel := make(map[string]int)
188-
for i := 0; i < 166; i++ {
188+
for i := range 166 {
189189
plutusV1CostModel[strconv.Itoa(i)] = i + 1 // "0":1, "1":2, etc.
190190
}
191191

@@ -261,7 +261,7 @@ func TestScientificNotationInCostModels(t *testing.T) {
261261
}
262262

263263
expected := []int64{2477736, 1500000, 1000000}
264-
for i := 0; i < 3; i++ {
264+
for i := range 3 {
265265
if params.CostModels[alonzo.PlutusV1Key][i] != expected[i] {
266266
t.Errorf("parameter %d conversion failed: got %d, want %d",
267267
i, params.CostModels[alonzo.PlutusV1Key][i], expected[i])

0 commit comments

Comments
 (0)