Code

Lua plugin: wrap debug code in COLLECT_DEBUG
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Sat, 13 Aug 2016 12:37:15 +0000 (14:37 +0200)
committerRuben Kerkhof <ruben@rubenkerkhof.com>
Sat, 13 Aug 2016 12:37:15 +0000 (14:37 +0200)
No use formatting the string if we're not going to use it.

src/lua.c

index bbfcb2f81c1864812e0797564811702863383b02..b89c824001f6bffc1770ae80914a8145e7f9484d 100644 (file)
--- a/src/lua.c
+++ b/src/lua.c
@@ -260,6 +260,7 @@ static int lua_cb_dispatch_values(lua_State *L) /* {{{ */
   if (vl == NULL)
     return luaL_error(L, "%s", "luaC_tovaluelist failed");
 
+#if COLLECT_DEBUG
   char identifier[6 * DATA_MAX_NAME_LEN];
   FORMAT_VL(identifier, sizeof(identifier), vl);
 
@@ -267,6 +268,7 @@ static int lua_cb_dispatch_values(lua_State *L) /* {{{ */
         "time %.3f, interval %.3f.",
         identifier, CDTIME_T_TO_DOUBLE(vl->time),
         CDTIME_T_TO_DOUBLE(vl->interval));
+#endif
 
   plugin_dispatch_values(vl);