@@ -126,15 +126,14 @@ prepared_lua_function_t::prepared_lua_function_t(lua_State *lua_state,
126126namespace {
127127
128128void push_osm_object_to_lua_stack (lua_State *lua_state,
129- osmium::OSMObject const &object,
130- bool with_attributes)
129+ osmium::OSMObject const &object)
131130{
132131 assert (lua_state);
133132
134133 /* *
135- * Table will always have at least 3 fields (id, type, tags). And 5 more if
136- * with_attributes is true (version, timestamp, changeset, uid, user). For
137- * ways there are 2 more (is_closed, nodes), for relations 1 more (members).
134+ * Table will always have at least 8 fields (id, type, tags, version,
135+ * timestamp, changeset, uid, user). For ways there are 2 more (is_closed,
136+ * nodes), for relations 1 more (members).
138137 */
139138 constexpr int const max_table_size = 10 ;
140139
@@ -145,23 +144,21 @@ void push_osm_object_to_lua_stack(lua_State *lua_state,
145144 luaX_add_table_str (lua_state, " type" ,
146145 osmium::item_type_to_name (object.type ()));
147146
148- if (with_attributes) {
149- if (object.version () != 0U ) {
150- luaX_add_table_int (lua_state, " version" , object.version ());
151- }
152- if (object.timestamp ().valid ()) {
153- luaX_add_table_int (lua_state, " timestamp" ,
154- object.timestamp ().seconds_since_epoch ());
155- }
156- if (object.changeset () != 0U ) {
157- luaX_add_table_int (lua_state, " changeset" , object.changeset ());
158- }
159- if (object.uid () != 0U ) {
160- luaX_add_table_int (lua_state, " uid" , object.uid ());
161- }
162- if (object.user ()[0 ] != ' \0 ' ) {
163- luaX_add_table_str (lua_state, " user" , object.user ());
164- }
147+ if (object.version () != 0U ) {
148+ luaX_add_table_int (lua_state, " version" , object.version ());
149+ }
150+ if (object.timestamp ().valid ()) {
151+ luaX_add_table_int (lua_state, " timestamp" ,
152+ object.timestamp ().seconds_since_epoch ());
153+ }
154+ if (object.changeset () != 0U ) {
155+ luaX_add_table_int (lua_state, " changeset" , object.changeset ());
156+ }
157+ if (object.uid () != 0U ) {
158+ luaX_add_table_int (lua_state, " uid" , object.uid ());
159+ }
160+ if (object.user ()[0 ] != ' \0 ' ) {
161+ luaX_add_table_str (lua_state, " user" , object.user ());
165162 }
166163
167164 if (object.type () == osmium::item_type::way) {
@@ -692,8 +689,7 @@ int output_flex_t::table_insert()
692689 lua_pushboolean (lua_state (), false );
693690 lua_pushstring (lua_state (), " null value in not null column." );
694691 lua_pushstring (lua_state (), e.column ().name ().c_str ());
695- push_osm_object_to_lua_stack (lua_state (), object,
696- get_options ()->extra_attributes );
692+ push_osm_object_to_lua_stack (lua_state (), object);
697693 table_connection.increment_not_null_error_counter ();
698694 return 4 ;
699695 }
@@ -820,9 +816,7 @@ void output_flex_t::call_lua_function(prepared_lua_function_t func,
820816 m_calling_context = func.context ();
821817
822818 lua_pushvalue (lua_state (), func.index ()); // the function to call
823- push_osm_object_to_lua_stack (
824- lua_state (), object,
825- get_options ()->extra_attributes ); // the single argument
819+ push_osm_object_to_lua_stack (lua_state (), object); // the single argument
826820
827821 luaX_set_context (lua_state (), this );
828822 if (luaX_pcall (lua_state (), 1 , func.nresults ())) {
0 commit comments