Skip to content

Commit 9ba4731

Browse files
committed
Simplify code order
1 parent b6b7151 commit 9ba4731

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/flex-lua-geom.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,11 +309,11 @@ void init_geometry_class(lua_State *lua_state)
309309
// Add metatable as osm2pgsql.Geometry so we can access it from Lua
310310
lua_setfield(lua_state, -3, "Geometry");
311311

312+
lua_pushvalue(lua_state, -1);
313+
lua_setfield(lua_state, -2, "__index");
312314
luaX_add_table_func(lua_state, "__gc", geom_gc);
313315
luaX_add_table_func(lua_state, "__len", geom_num_geometries);
314316
luaX_add_table_func(lua_state, "__tostring", geom_tostring);
315-
lua_pushvalue(lua_state, -1);
316-
lua_setfield(lua_state, -2, "__index");
317317
luaX_add_table_func(lua_state, "area", geom_area);
318318
luaX_add_table_func(lua_state, "length", geom_length);
319319
luaX_add_table_func(lua_state, "centroid", geom_centroid);

0 commit comments

Comments
 (0)