From 709ee2bfec0491fa362822f2618a97e446b1f58c Mon Sep 17 00:00:00 2001 From: scheffle Date: Thu, 21 Dec 2023 17:53:04 +0100 Subject: [PATCH] simple refactoring --- vstgui/uidescription-scripting/tiny-js/TinyJS.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/vstgui/uidescription-scripting/tiny-js/TinyJS.cpp b/vstgui/uidescription-scripting/tiny-js/TinyJS.cpp index 9ac318a6f..1bb9e4ed4 100644 --- a/vstgui/uidescription-scripting/tiny-js/TinyJS.cpp +++ b/vstgui/uidescription-scripting/tiny-js/TinyJS.cpp @@ -828,24 +828,20 @@ std::string CScriptLex::getPosition (size_t pos) const // ----------------------------------------------------------------------------------- // CSCRIPTVARLINK -CScriptVarLink::CScriptVarLink (CScriptVar* var, const std::string& name, bool own) +CScriptVarLink::CScriptVarLink (CScriptVar* inVar, const std::string& inName, bool own) +: name (inName), var (inVar->addRef ()), isOwned (own) { #if DEBUG_MEMORY mark_allocated (this); #endif - this->name = name; - this->var = var->addRef (); - this->isOwned = own; } CScriptVarLink::CScriptVarLink (const CScriptVarLink& link) +: name (link.name), var (link.var->addRef ()) { - // Copy constructor #if DEBUG_MEMORY mark_allocated (this); #endif - this->name = link.name; - this->var = link.var->addRef (); } CScriptVarLink::~CScriptVarLink ()