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

Jochen Topf notifications at github.com
Thu May 14 16:04:49 UTC 2020


@joto 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;

Comments have a tendency to get out of date. Osm2pgsql is full of comments that are wrong, sometimes commenting something that isn't there any more.

-- 
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_r425253517
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20200514/863de650/attachment.htm>


More information about the Tile-serving mailing list