From a7e8bbb080aef318b16750ca1771d0d3af3d0ae9 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 22 Dec 2013 19:33:35 -0500 Subject: [PATCH] Minor fraction mask setting improvement --- src/hb-ot-map-private.hh | 2 -- src/hb-ot-shape.cc | 8 +++++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/hb-ot-map-private.hh b/src/hb-ot-map-private.hh index 1b4f0296..0e718a6f 100644 --- a/src/hb-ot-map-private.hh +++ b/src/hb-ot-map-private.hh @@ -88,8 +88,6 @@ struct hb_ot_map_t return map ? map->needs_fallback : false; } - /* XXX get_1_mask is actually unsafe if feature has more than - * one bit. */ inline hb_mask_t get_1_mask (hb_tag_t feature_tag) const { const feature_map_t *map = features.bsearch (&feature_tag); return map ? map->_1_mask : 0; diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc index f9adfd25..55ddbb58 100644 --- a/src/hb-ot-shape.cc +++ b/src/hb-ot-shape.cc @@ -346,9 +346,11 @@ hb_ot_shape_setup_masks_fraction (hb_ot_shape_context_t *c) HB_UNICODE_GENERAL_CATEGORY_DECIMAL_NUMBER) end++; - buffer->set_masks (frac_mask, frac_mask, start, end); - buffer->set_masks (numr_mask, numr_mask, start, i); - buffer->set_masks (dnom_mask, dnom_mask, i + 1, end); + for (unsigned int j = start; j < i; j++) + info[j].mask |= numr_mask | frac_mask; + info[i].mask |= frac_mask; + for (unsigned int j = i + 1; j < end; j++) + info[j].mask |= frac_mask | dnom_mask; i = end - 1; } -- GitLab