This commit is contained in:
Behdad Esfahbod 2015-02-21 16:49:15 +03:00
parent 68e04afbb1
commit ef79bdf73b
1 changed files with 3 additions and 2 deletions

View File

@ -984,8 +984,9 @@ struct ClassDefFormat1
private: private:
inline unsigned int get_class (hb_codepoint_t glyph_id) const inline unsigned int get_class (hb_codepoint_t glyph_id) const
{ {
if (unlikely ((unsigned int) (glyph_id - startGlyph) < classValue.len)) unsigned int i = (unsigned int) (glyph_id - startGlyph);
return classValue[glyph_id - startGlyph]; if (unlikely (i < classValue.len))
return classValue[i];
return 0; return 0;
} }