From f04032e450293d2714f731212f2c99e30842c8e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Pereira?= Date: Mon, 22 Jun 2020 13:31:54 +0100 Subject: [PATCH] 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. --- lib/ShellCommand.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/ShellCommand.cpp b/lib/ShellCommand.cpp index 5b86537..03afa45 100644 --- a/lib/ShellCommand.cpp +++ b/lib/ShellCommand.cpp @@ -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; }