mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 02:50:46 -06:00
Don't pretend to move columns when they aren't to be moved
This is purely a performance optimisation. It reduced the number of calls to Table::setField() from three to two when the user only wants to rename a field in EditTableDialog and not move it.
This commit is contained in:
@@ -976,11 +976,15 @@ bool DBBrowserDB::renameColumn(const QString& tablename, const QString& name, sq
|
||||
} else {
|
||||
// We want to modify it
|
||||
|
||||
// Move field
|
||||
int index = newSchema.findField(name);
|
||||
sqlb::FieldPtr temp = newSchema.fields().at(index);
|
||||
newSchema.setField(index, newSchema.fields().at(index + move));
|
||||
newSchema.setField(index + move, temp);
|
||||
|
||||
// Move field
|
||||
if(move)
|
||||
{
|
||||
sqlb::FieldPtr temp = newSchema.fields().at(index);
|
||||
newSchema.setField(index, newSchema.fields().at(index + move));
|
||||
newSchema.setField(index + move, temp);
|
||||
}
|
||||
|
||||
// Get names of fields to select from old table now - after the field has been moved and before it might be renamed
|
||||
for(int i=0;i<newSchema.fields().count();++i)
|
||||
|
||||
Reference in New Issue
Block a user