printf is slow compared to simply appending '1' or '0' characters to the
GString.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I2605c1e6d2dc463be237e8eb00f70a84e4c5fd1a
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1507
CI-Build: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
bt_common_g_string_append(pretty->string, "0b");
_bt_safe_lshift(v.u, 64 - len);
for (bitnr = 0; bitnr < len; bitnr++) {
- bt_common_g_string_append_printf(pretty->string, "%u", (v.u & (1ULL << 63)) ? 1 : 0);
+ bt_common_g_string_append_c(pretty->string,
+ (v.u & (1ULL << 63)) ? '1' : '0');
_bt_safe_lshift(v.u, 1);
}
break;