From 7d205330dbf1c2fd44d9d58393ab46434ac8bb5e Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Sun, 25 Jun 2023 18:12:54 +1000 Subject: More directives optimization --- source/game/StarTechController.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'source/game/StarTechController.cpp') diff --git a/source/game/StarTechController.cpp b/source/game/StarTechController.cpp index 1734c61..7ceb54e 100644 --- a/source/game/StarTechController.cpp +++ b/source/game/StarTechController.cpp @@ -251,7 +251,7 @@ Maybe TechController::parentState() const { return m_parentState.get(); } -String TechController::parentDirectives() const { +DirectivesGroup const& TechController::parentDirectives() const { return m_parentDirectives.get(); } @@ -501,10 +501,11 @@ LuaCallbacks TechController::makeTechCallbacks(TechModule& techModule) { callbacks.registerCallback("setParentDirectives", [this, &techModule](Maybe const& directives) { techModule.parentDirectives = directives.value(); - String newParentDirectives; + + DirectivesGroup newParentDirectives; for (auto& module : m_techModules) - newParentDirectives += module.parentDirectives; - m_parentDirectives.set(newParentDirectives); + newParentDirectives.append(module.parentDirectives); + m_parentDirectives.set(move(newParentDirectives)); }); callbacks.registerCallback("setParentHidden", [this](bool hidden) { -- cgit v1.2.3