[code] Avoid dynamic allocation and useless string copy by keeping the

importation status flag in the areaBuffer
This commit is contained in:
Émilie Feral
2018-09-11 16:21:35 +02:00
parent db3cd16128
commit 79740e72b0
9 changed files with 25 additions and 45 deletions

View File

@@ -57,9 +57,10 @@ void App::Snapshot::setOpt(const char * name, char * value) {
}
*separator = 0;
const char * scriptName = value;
const char * scriptContent = separator+1;
const char * scriptContent = separator;
Code::ScriptTemplate script(scriptName, scriptContent);
m_scriptStore.addScriptFromTemplate(&script);
m_scriptStore.scriptNamed(scriptName).toggleImportationStatus(); // set Importation Status to 1
return;
}
if (strcmp(name, "lock-on-console") == 0) {