From 4303be8a4c343ad9085c2857cabc8e55f3bac525 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Sun, 28 Nov 2010 02:23:05 +0100 Subject: Changing the hashmap in LuaTask to a true C++ map. --- lib/LuaTask.cc | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'lib/LuaTask.cc') 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 #endif -htab * LuaTask::h = hcreate(1); +std::map 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() { -- cgit v1.2.3