diff options
Diffstat (limited to 'src/lua/lua_cdb.c')
-rw-r--r-- | src/lua/lua_cdb.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/lua/lua_cdb.c b/src/lua/lua_cdb.c index 5d4c499a7..1f9b48260 100644 --- a/src/lua/lua_cdb.c +++ b/src/lua/lua_cdb.c @@ -151,17 +151,7 @@ lua_load_cdb (lua_State *L) void luaopen_cdb (lua_State * L) { - luaL_newmetatable (L, "rspamd{cdb}"); - lua_pushstring (L, "__index"); - lua_pushvalue (L, -2); - lua_settable (L, -3); - - lua_pushstring (L, "class"); - lua_pushstring (L, "rspamd{cdb}"); - lua_rawset (L, -3); - - luaL_register (L, NULL, cdblib_m); - lua_pop (L, 1); /* remove metatable from stack */ - + rspamd_lua_new_class (L, "rspamd{cdb}", cdblib_m); + lua_pop (L, 1); rspamd_lua_add_preload (L, "rspamd_cdb", lua_load_cdb); } |