Move initialization to the initialization list

When the object of a class is created, the constructors of all member
variables are called consecutively in the order the variables are declared,
even if we don't explicitly write them to the initialization list.
This commit is contained in:
Luís Pereira
2020-06-22 13:31:54 +01:00
committed by Chih-Hsuan Yen
parent b30730b0e4
commit f04032e450
+1 -2
View File
@@ -59,9 +59,8 @@ ShellCommand::ShellCommand(const QString & fullCommand)
}
}
ShellCommand::ShellCommand(const QString & command , const QStringList & arguments)
: _arguments(arguments)
{
_arguments = arguments;
if ( !_arguments.isEmpty() ) {
_arguments[0] = command;
}