aboutsummaryrefslogtreecommitdiffstats
path: root/util-src/encodings.c
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2014-09-17 02:23:17 +0200
committerKim Alvefur <zash@zash.se>2014-09-17 02:23:17 +0200
commit110fb5576b604fdff69dd7d6cedeec4fee7fe361 (patch)
treecc0d784c48dd70d272897cbf4cc39ceed6c3479e /util-src/encodings.c
parentbcab7a928a24ff7da693c6c8370ab18ae19284bd (diff)
downloadprosody-110fb5576b604fdff69dd7d6cedeec4fee7fe361.tar.gz
prosody-110fb5576b604fdff69dd7d6cedeec4fee7fe361.zip
util-src/*.c: Use the more concise lua_setfield
Diffstat (limited to 'util-src/encodings.c')
-rw-r--r--util-src/encodings.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/util-src/encodings.c b/util-src/encodings.c
index 3a074949..fb838551 100644
--- a/util-src/encodings.c
+++ b/util-src/encodings.c
@@ -368,23 +368,19 @@ LUALIB_API int luaopen_util_encodings(lua_State *L)
#endif
lua_newtable(L);
- lua_pushliteral(L, "base64");
lua_newtable(L);
luaL_register(L, NULL, Reg_base64);
- lua_settable(L,-3);
+ lua_setfield(L, -2, "base64");
- lua_pushliteral(L, "stringprep");
lua_newtable(L);
luaL_register(L, NULL, Reg_stringprep);
- lua_settable(L,-3);
+ lua_setfield(L, -2, "stringprep");
- lua_pushliteral(L, "idna");
lua_newtable(L);
luaL_register(L, NULL, Reg_idna);
- lua_settable(L,-3);
+ lua_setfield(L, -2, "idna");
- lua_pushliteral(L, "version"); /** version */
lua_pushliteral(L, "-3.14");
- lua_settable(L,-3);
+ lua_setfield(L, -2, "version");
return 1;
}