summaryrefslogtreecommitdiff
path: root/src/sql
diff options
context:
space:
mode:
authorAlbert Astals Cid <albert.astals.cid@kdab.com>2019-10-11 17:31:22 +0200
committerAlbert Astals Cid <albert.astals.cid@kdab.com>2019-10-25 09:39:39 +0200
commit9d504e1150e4bd49d34aba5cee938d1fd9f7e80c (patch)
tree4aa87087f3199a33a83b20134faabdcf9856f51c /src/sql
parent375efdd0e157a80de08627612e36597a22c6ac06 (diff)
downloadqtbase-9d504e1150e4bd49d34aba5cee938d1fd9f7e80c.tar.gz
QSqlTableModel::record: Use the const & we're given
QSqlTableModelPrivate::ModifiedRow::rec returns a const & so use it instead doing a copy. QSqlRecord is cheap to copy constructor but not having to do it is faster Change-Id: Iad6e79fcdcdf380ce681fe9426436f8cb98be553 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Diffstat (limited to 'src/sql')
-rw-r--r--src/sql/models/qsqltablemodel.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sql/models/qsqltablemodel.cpp b/src/sql/models/qsqltablemodel.cpp
index 4bc9a8c2f8..ba8a6dea36 100644
--- a/src/sql/models/qsqltablemodel.cpp
+++ b/src/sql/models/qsqltablemodel.cpp
@@ -1369,7 +1369,7 @@ QSqlRecord QSqlTableModel::record(int row) const
// get generated flags from the cache
const QSqlTableModelPrivate::ModifiedRow mrow = d->cache.value(row);
if (mrow.op() != QSqlTableModelPrivate::None) {
- const QSqlRecord crec = mrow.rec();
+ const QSqlRecord &crec = mrow.rec();
for (int i = 0, cnt = rec.count(); i < cnt; ++i)
rec.setGenerated(i, crec.isGenerated(i));
}