mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-07 06:53:09 -06:00
make for loops consistent
This commit is contained in:
parent
4a8fba382c
commit
97a87d7ecc
|
|
@ -478,11 +478,10 @@ func (s *statements) selectEventJSONs(eventNIDs []int64) ([]eventJSONPair, error
|
||||||
// We might get fewer results than NIDs so we adjust the length of the slice before returning it.
|
// We might get fewer results than NIDs so we adjust the length of the slice before returning it.
|
||||||
results := make([]eventJSONPair, len(eventNIDs))
|
results := make([]eventJSONPair, len(eventNIDs))
|
||||||
i := 0
|
i := 0
|
||||||
for rows.Next() {
|
for ; rows.Next(); i++ {
|
||||||
if err := rows.Scan(&results[i].EventNID, &results[i].EventJSON); err != nil {
|
if err := rows.Scan(&results[i].EventNID, &results[i].EventJSON); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
i++
|
|
||||||
}
|
}
|
||||||
return results[:i], nil
|
return results[:i], nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue