Skip to content

Commit 3bfec01

Browse files
authored
Use constant references when iterating over ranges in replace_range / insert_range
1 parent 482c6dc commit 3bfec01

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/sqlite_orm/sqlite_orm.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12358,7 +12358,7 @@ namespace sqlite_orm {
1235812358
auto stmt = statement.stmt;
1235912359
sqlite3_reset(stmt);
1236012360
for(auto it = statement.t.range.first; it != statement.t.range.second; ++it) {
12361-
auto &o = *it;
12361+
const auto &o = *it;
1236212362
tImpl.table.for_each_column([&o, &index, &stmt, db](auto &c) {
1236312363
using column_type = typename std::decay<decltype(c)>::type;
1236412364
using field_type = typename column_type::field_type;
@@ -12399,7 +12399,7 @@ namespace sqlite_orm {
1239912399
auto &tImpl = this->get_impl<object_type>();
1240012400
sqlite3_reset(stmt);
1240112401
for(auto it = statement.t.range.first; it != statement.t.range.second; ++it) {
12402-
auto &o = *it;
12402+
const auto &o = *it;
1240312403
tImpl.table.for_each_column([&o, &index, &stmt, db](auto &c) {
1240412404
if(!c.template has<constraints::primary_key_t<>>()) {
1240512405
using column_type = typename std::decay<decltype(c)>::type;

0 commit comments

Comments
 (0)