QSqlTableModel: remove a call to cache.empty()
The call to the const `empty()` didn't do anything, because its results were unused. Since this code has not been touched for some ~13 years, just drop the call. (Probably clear() was intended, however doing that change makes the corresponding autotest fail.) Aggressively cherry-picking because I want to also cherry pick [[nodiscard]] on empty() (which would've found this bug N years ago.) Change-Id: I801d0c364a7122bb26d407c23ae99278939c50ff Pick-to: 6.5 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> Reviewed-by: David Faure <david.faure@kdab.com> (cherry picked from commit 95c55d6f3216bfeb6d802fb70e455849b8c3567f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
9399ffd301
commit
3210c4c691
@ -1108,9 +1108,6 @@ bool QSqlTableModel::insertRows(int row, int count, const QModelIndex &parent)
|
||||
d->busyInsertingRows = true;
|
||||
beginInsertRows(parent, row, row + count - 1);
|
||||
|
||||
if (d->strategy != OnManualSubmit)
|
||||
d->cache.empty();
|
||||
|
||||
if (!d->cache.isEmpty()) {
|
||||
QMap<int, QSqlTableModelPrivate::ModifiedRow>::Iterator it = d->cache.end();
|
||||
while (it != d->cache.begin() && (--it).key() >= row) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user