Skip to content

Commit

Permalink
Minor optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
behdad committed Jan 27, 2015
1 parent 675956a commit 1eff435
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/hb-ot-shape-normalize.cc
Original file line number Diff line number Diff line change
Expand Up @@ -197,16 +197,17 @@ static inline void
decompose_current_character (const hb_ot_shape_normalize_context_t *c, bool shortest)
{
hb_buffer_t * const buffer = c->buffer;
hb_codepoint_t u = buffer->cur().codepoint;
hb_codepoint_t glyph;

/* Kind of a cute waterfall here... */
if (shortest && c->font->get_glyph (buffer->cur().codepoint, 0, &glyph))
if (shortest && c->font->get_glyph (u, 0, &glyph))
next_char (buffer, glyph);
else if (decompose (c, shortest, buffer->cur().codepoint))
else if (decompose (c, shortest, u))
skip_char (buffer);
else if (!shortest && c->font->get_glyph (buffer->cur().codepoint, 0, &glyph))
else if (!shortest && c->font->get_glyph (u, 0, &glyph))
next_char (buffer, glyph);
else if (decompose_compatibility (c, buffer->cur().codepoint))
else if (decompose_compatibility (c, u))
skip_char (buffer);
else
next_char (buffer, glyph); /* glyph is initialized in earlier branches. */
Expand Down

0 comments on commit 1eff435

Please sign in to comment.