From 71277185454482cff9b0c10b85c416eb4d6e0ed9 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 2 Nov 2015 17:27:48 -0800 Subject: [PATCH] [perf] Only call combining_class() for marks Saves some time. Also preparing for reusing the ccc byte for other stuff. --- src/hb-ot-layout-private.hh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/hb-ot-layout-private.hh b/src/hb-ot-layout-private.hh index d168e27f5..075a568b5 100644 --- a/src/hb-ot-layout-private.hh +++ b/src/hb-ot-layout-private.hh @@ -224,12 +224,14 @@ enum { static inline void _hb_glyph_info_set_unicode_props (hb_glyph_info_t *info, hb_unicode_funcs_t *unicode) { - /* XXX This shouldn't be inlined, or at least not while is_default_ignorable() is inline. */ - info->unicode_props0() = ((unsigned int) unicode->general_category (info->codepoint)) | - (unicode->is_default_ignorable (info->codepoint) ? MASK0_IGNORABLE : 0) | - (info->codepoint == 0x200Cu ? MASK0_ZWNJ : 0) | - (info->codepoint == 0x200Du ? MASK0_ZWJ : 0); - info->unicode_props1() = unicode->modified_combining_class (info->codepoint); + unsigned int gen_cat = (unsigned int) unicode->general_category (info->codepoint); + /* XXX This wouldn't be inlined, or at least not while is_default_ignorable() is inline. */ + info->unicode_props0() = gen_cat | + (unicode->is_default_ignorable (info->codepoint) ? MASK0_IGNORABLE : 0) | + (info->codepoint == 0x200Cu ? MASK0_ZWNJ : 0) | + (info->codepoint == 0x200Du ? MASK0_ZWJ : 0); + info->unicode_props1() = unlikely (HB_UNICODE_GENERAL_CATEGORY_IS_MARK (gen_cat)) ? + unicode->modified_combining_class (info->codepoint) : 0; } static inline void