Skip to content

Commit

Permalink
Fix unnecessary recomputation
Browse files Browse the repository at this point in the history
  • Loading branch information
milogreg committed Jan 13, 2025
1 parent f86a441 commit d0fca91
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions go/libraries/doltcore/sqle/dtables/help_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,16 @@ func NewHelpRowIter() HelpRowIter {
var DoltCommand cli.SubCommandHandler

func (itr HelpRowIter) Next(_ *sql.Context) (sql.Row, error) {
helpRows := *itr.rows
if helpRows == nil {
if *itr.rows == nil {
var err error
helpRows, err = generateProcedureHelpRows(DoltCommand.Name(), DoltCommand.Subcommands)
*itr.rows, err = generateProcedureHelpRows(DoltCommand.Name(), DoltCommand.Subcommands)
if err != nil {
return nil, err
}
}

helpRows := *itr.rows

if *itr.idx >= len(helpRows) {
return nil, io.EOF
}
Expand Down

0 comments on commit d0fca91

Please sign in to comment.