aboutsummaryrefslogtreecommitdiff
path: root/src/lua/common/je_lua.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lua/common/je_lua.cpp')
-rw-r--r--src/lua/common/je_lua.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/lua/common/je_lua.cpp b/src/lua/common/je_lua.cpp
index 21d3fa6..1c1f5aa 100644
--- a/src/lua/common/je_lua.cpp
+++ b/src/lua/common/je_lua.cpp
@@ -32,8 +32,7 @@ namespace JinEngine
LuaObject* luax_newinstance(lua_State* L, LuaObject* src)
{
- bool another = L != src->state;
- if(another)
+ if(L != src->state)
{
// Copy dependencies.
map<uint, SharedBase*>::iterator it = (*src->dependencies).begin();
@@ -56,14 +55,11 @@ namespace JinEngine
luax_settable(L, -3);
luax_pop(L, 1); // Pop objects table.
// Set dependencies.
- if (another)
+ map<uint, SharedBase*>::iterator it = (*obj->dependencies).begin();
+ for (; it != (*obj->dependencies).end(); ++it)
{
- map<uint, SharedBase*>::iterator it = (*obj->dependencies).begin();
- for (; it != (*obj->dependencies).end(); ++it)
- {
- SharedBase* dep = it->second;
- luax_addreference(L, shr, dep);
- }
+ SharedBase* dep = it->second;
+ luax_addreference(L, shr, dep);
}
return obj;
}