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:
committed by
Chih-Hsuan Yen
parent
b30730b0e4
commit
f04032e450
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user