diff --git a/src/hb-ot-layout-common.hh b/src/hb-ot-layout-common.hh index eca70ad62..ac9145151 100644 --- a/src/hb-ot-layout-common.hh +++ b/src/hb-ot-layout-common.hh @@ -647,10 +647,6 @@ struct Lookup { unsigned int get_subtable_count () const { return subTable.len; } - template - const TSubTable& get_subtable (unsigned int i) const - { return this+CastR> (subTable)[i]; } - template const OffsetArrayOf& get_subtables () const { return CastR> (subTable); } @@ -658,6 +654,13 @@ struct Lookup OffsetArrayOf& get_subtables () { return CastR> (subTable); } + template + const TSubTable& get_subtable (unsigned int i) const + { return this+get_subtables ()[i]; } + template + TSubTable& get_subtable (unsigned int i) + { return this+get_subtables ()[i]; } + unsigned int get_size () const { const HBUINT16 &markFilteringSet = StructAfter (subTable); @@ -745,8 +748,7 @@ struct Lookup if (!markFilteringSet.sanitize (c)) return_trace (false); } - if (unlikely (!CastR> (subTable) - .sanitize (c, this, get_type ()))) + if (unlikely (!get_subtables ().sanitize (c, this, get_type ()))) return_trace (false); if (unlikely (get_type () == TSubTable::Extension))