diff options
author | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2010-11-29 21:50:29 +0100 |
---|---|---|
committer | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2010-11-29 21:50:29 +0100 |
commit | 977c77aa085b10e48505c861f5d47b3e881170e2 (patch) | |
tree | 985647f8f00798d7e2e499305b66d222242e6b40 /lib/LuaTask.cc | |
parent | 0fd6cb126b6238d2cbc01bed12ff043f45039c76 (diff) | |
parent | c99762a8980e691bab478f67b56b3fde56694e86 (diff) |
Merge branch 'master' of /pub/repo.git/Baltisot
Diffstat (limited to 'lib/LuaTask.cc')
-rw-r--r-- | lib/LuaTask.cc | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/lib/LuaTask.cc b/lib/LuaTask.cc index ef1abf7..b475c5b 100644 --- a/lib/LuaTask.cc +++ b/lib/LuaTask.cc @@ -30,7 +30,7 @@ #include <CopyJob.h> #endif -htab * LuaTask::h = hcreate(1); +std::map<Lua *, LuaTask *> LuaTask::h; LuaTask::LuaTask(Lua * __L, const String & _cmd, bool _destroy_VM) : L(__L), cmd(_cmd), nargs(0), c(0), b(0), destroy_VM(_destroy_VM) { LuaTask * top = gettop(); @@ -62,21 +62,11 @@ LuaTask::~LuaTask() { } LuaTask * LuaTask::gettop() { - if (!hfind(h, (Uint8 *) &L, sizeof(L))) { - hadd(h, (Uint8 *) &L, sizeof(L), 0); - } - - return (LuaTask *) hstuff(h); + return h[L]; } void LuaTask::settop(LuaTask * v) { - if (!hfind(h, (Uint8 *) &L, sizeof(L))) - return; - if (v) { - hstuff(h) = v; - } else { - hdel(h); - } + h[L] = v; } String LuaTask::GetName() { |