[dracutlukscfg] Const data

The QLatin1String() might be replaced by char[], that trades one
initialization for two but with a simpler data section; this
probably is not worth profiling.
This commit is contained in:
Adriaan de Groot 2020-11-30 14:41:02 +01:00
parent 1f0aec5f87
commit 1f21b9ad73
2 changed files with 3 additions and 7 deletions

View File

@ -20,8 +20,7 @@
#include "utils/Logger.h" #include "utils/Logger.h"
// static static const QLatin1String CONFIG_FILE( "/etc/dracut.conf.d/calamares-luks.conf" );
const QLatin1String DracutLuksCfgJob::CONFIG_FILE( "/etc/dracut.conf.d/calamares-luks.conf" );
static const char CONFIG_FILE_HEADER[] static const char CONFIG_FILE_HEADER[]
= "# Configuration file automatically written by the Calamares system installer\n" = "# Configuration file automatically written by the Calamares system installer\n"
@ -36,9 +35,8 @@ static const char CONFIG_FILE_CRYPTTAB_KEYFILE_LINE[]
static const char CONFIG_FILE_CRYPTTAB_LINE[] = "# force installing /etc/crypttab even if hostonly=\"no\"\n" static const char CONFIG_FILE_CRYPTTAB_LINE[] = "# force installing /etc/crypttab even if hostonly=\"no\"\n"
"install_items+=\" /etc/crypttab \"\n"; "install_items+=\" /etc/crypttab \"\n";
// static static const QLatin1String
const QLatin1String DracutLuksCfgJob::CONFIG_FILE_SWAPLINE( CONFIG_FILE_SWAPLINE( "# enable automatic resume from swap\nadd_device+=\" /dev/disk/by-uuid/%1 \"\n" );
"# enable automatic resume from swap\nadd_device+=\" /dev/disk/by-uuid/%1 \"\n" );
static QString static QString
rootMountPoint() rootMountPoint()

View File

@ -33,8 +33,6 @@ public:
Calamares::JobResult exec() override; Calamares::JobResult exec() override;
private: private:
static const QLatin1String CONFIG_FILE;
static const QLatin1String CONFIG_FILE_SWAPLINE;
}; };
CALAMARES_PLUGIN_FACTORY_DECLARATION( DracutLuksCfgJobFactory ) CALAMARES_PLUGIN_FACTORY_DECLARATION( DracutLuksCfgJobFactory )