Skip to content

Commit 8fe75c1

Browse files
committed
Refactor MultiLineAssertion to use indexed access for SingleLineAssertions in Run method, improving clarity and performance.
1 parent 3ee106d commit 8fe75c1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/assertions/multi_line_assertion.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ func (a *MultiLineAssertion) Inspect() string {
5050
func (a *MultiLineAssertion) Run(screenState screen_state.ScreenState, startRowIndex int) (processedRowCount int, err *AssertionError) {
5151
totalProcessedRowCount := 0
5252

53-
for _, singleLineAssertion := range a.SingleLineAssertions {
54-
processedRowCount, err = singleLineAssertion.Run(screenState, startRowIndex+totalProcessedRowCount)
53+
for i := range a.SingleLineAssertions {
54+
processedRowCount, err = a.SingleLineAssertions[i].Run(screenState, startRowIndex+totalProcessedRowCount)
5555
if err != nil {
5656
return totalProcessedRowCount, err
5757
}

0 commit comments

Comments
 (0)