mirror of
https://github.com/matrix-org/dendrite
synced 2025-01-18 16:04:02 +00:00
Move variable declaration outside loop
This commit is contained in:
parent
c795a8fe1f
commit
31f7b44a02
2 changed files with 2 additions and 2 deletions
|
@ -97,9 +97,9 @@ func (s *eventJSONStatements) BulkSelectEventJSON(
|
|||
// We might get fewer results than NIDs so we adjust the length of the slice before returning it.
|
||||
results := make([]tables.EventJSONPair, len(eventNIDs))
|
||||
i := 0
|
||||
var eventNID int64
|
||||
for ; rows.Next(); i++ {
|
||||
result := &results[i]
|
||||
var eventNID int64
|
||||
if err := rows.Scan(&eventNID, &result.EventJSON); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
@ -101,9 +101,9 @@ func (s *eventJSONStatements) BulkSelectEventJSON(
|
|||
// We might get fewer results than NIDs so we adjust the length of the slice before returning it.
|
||||
results := make([]tables.EventJSONPair, len(eventNIDs))
|
||||
i := 0
|
||||
var eventNID int64
|
||||
for ; rows.Next(); i++ {
|
||||
result := &results[i]
|
||||
var eventNID int64
|
||||
if err := rows.Scan(&eventNID, &result.EventJSON); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue