Skip to content

Commit

Permalink
Slight optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonkers committed Sep 12, 2023
1 parent 2532330 commit e172680
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions bind.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ func bindPositional(tz *time.Location, query string, args ...any) (_ string, err
}
}

// If there were no replacements, quick return without copying the string
if lastMatchIndex < 0 {
return query, nil
}

// Append the remainder
buf = append(buf, query[lastMatchIndex+1:]...)

Expand Down

0 comments on commit e172680

Please sign in to comment.