Comparison

util-src/hashes.c @ 6412:0e94f89d0e62

util-src/*.c: Use the more concise lua_setfield
author Kim Alvefur <zash@zash.se>
date Wed, 17 Sep 2014 02:23:17 +0200
parent 6411:6c8f6364bc48
child 6413:a552f4170aed
comparison
equal deleted inserted replaced
6411:6c8f6364bc48 6412:0e94f89d0e62
203 203
204 LUALIB_API int luaopen_util_hashes(lua_State *L) 204 LUALIB_API int luaopen_util_hashes(lua_State *L)
205 { 205 {
206 lua_newtable(L); 206 lua_newtable(L);
207 luaL_register(L, NULL, Reg); 207 luaL_register(L, NULL, Reg);
208 lua_pushliteral(L, "version"); /** version */
209 lua_pushliteral(L, "-3.14"); 208 lua_pushliteral(L, "-3.14");
210 lua_settable(L,-3); 209 lua_setfield(L, -2, "version");
211 return 1; 210 return 1;
212 } 211 }