if (metric_res) {
if ((s = g_hash_table_lookup (metric_res->symbols, symbol)) != NULL) {
j = 1;
- lua_newtable (L);
+ lua_createtable (L, 0, 5);
lua_pushstring (L, "metric");
lua_pushstring (L, metric->name);
lua_settable (L, -3);
if (task && symbol) {
metric_list = g_hash_table_lookup (task->cfg->metrics_symbols, symbol);
if (metric_list) {
- lua_newtable (L);
+ lua_createtable (L, 1, 0);
cur = metric_list;
}
else {
}
if (!cur && metric) {
+ lua_createtable (L, 1, 0);
+
if ((found = lua_push_symbol_result (L, task, metric, symbol))) {
- lua_newtable (L);
lua_rawseti (L, -2, i++);
}
+ else {
+ /* Pop table */
+ lua_pop (L, 1);
+ }
}
else {
while (cur) {