[Tile-serving] [openstreetmap/osm2pgsql] Remove verbose comments and else after return (#1169)

SomeoneElseOSM notifications at github.com
Thu May 14 19:28:55 UTC 2020


@SomeoneElseOSM commented on this pull request.



> @@ -153,29 +153,26 @@ static int pcall_error_traceback_handler(lua_State *lua_state)
     assert(lua_state);
 
     char const *msg = lua_tostring(lua_state, 1);
-    if (msg == nullptr) { // is error object not a string?
-        if (luaL_callmeta(lua_state, 1,
-                          "__tostring") && // does it have a metamethod
-            lua_type(lua_state, -1) == LUA_TSTRING) { // that produces a string?
-            return 1;                                 // that is the message
-        } else {
-            msg = lua_pushfstring(lua_state, "(error object is a %s value)",
-                                  luaL_typename(lua_state, 1));
+    if (msg == nullptr) {
+        if (luaL_callmeta(lua_state, 1, "__tostring") &&
+            lua_type(lua_state, -1) == LUA_TSTRING) {
+            return 1;

Whilst I certainly wished for more explanatory comments that last time I was looking at osm2pgsql's lua interface, I'm not convinced that the ones being removed here are a great loss.  What would have been really useful though would be an actual document describing how it works (and how to expand it).

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/pull/1169#discussion_r425379409
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20200514/1d6ed461/attachment.htm>


More information about the Tile-serving mailing list