Skip to content

Commit f5ea171

Browse files
committed
Minor refactoring.
Several places were passing in a temporary int to capture the value of an int to pass it into an output paramater and then return the return value of the original function call. I don't think the redundancy adds clarity.
1 parent 2b40d72 commit f5ea171

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

slabs.c

+3-9
Original file line numberDiff line numberDiff line change
@@ -348,17 +348,11 @@ char *get_stats(const char *stat_type, int nkey,
348348

349349
return buf;
350350
} else if (nz_strcmp(nkey, stat_type, "items") == 0) {
351-
buf = item_stats(add_stats, c, &size);
352-
*buflen = size;
353-
return buf;
351+
return item_stats(add_stats, c, buflen);
354352
} else if (nz_strcmp(nkey, stat_type, "slabs") == 0) {
355-
buf = slabs_stats(add_stats, c, &size);
356-
*buflen = size;
357-
return buf;
353+
return slabs_stats(add_stats, c, buflen);
358354
} else if (nz_strcmp(nkey, stat_type, "sizes") == 0) {
359-
buf = item_stats_sizes(add_stats, c, &size);
360-
*buflen = size;
361-
return buf;
355+
return item_stats_sizes(add_stats, c, buflen);
362356
}
363357

364358
return NULL;

0 commit comments

Comments
 (0)