From 9109f1e944dd4bd4ae8057b75c8a31e9d31797aa Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 8 Jul 2014 20:02:29 -0400 Subject: [PATCH] [util/hb-shape] Accept an empty output-format that would skip output Useful for benchmarking, to avoid buffer serialization overhead (which seems to by far dominate shaping!) --- util/hb-shape.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/util/hb-shape.cc b/util/hb-shape.cc index b7d2ca6c3..324934a68 100644 --- a/util/hb-shape.cc +++ b/util/hb-shape.cc @@ -48,7 +48,10 @@ struct output_buffer_t output_format = HB_BUFFER_SERIALIZE_FORMAT_TEXT; else output_format = hb_buffer_serialize_format_from_string (options.output_format, -1); - if (!hb_buffer_serialize_format_to_string (output_format)) + /* An empty "output_format" parameter basically skips output generating. + * Useful for benchmarking. */ + if (*options.output_format && + !hb_buffer_serialize_format_to_string (output_format)) { if (options.explicit_output_format) fail (false, "Unknown output format `%s'; supported formats are: %s",