From: Behdad Esfahbod Date: Thu, 18 Apr 2013 03:04:03 +0000 (-0400) Subject: Obssesive optimization X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0dc3a4e0349d28f387a3b4c60a2f51962742738e;p=platform%2Fupstream%2FlibHarfBuzzSharp.git Obssesive optimization Not measurable by any means, but conceptually this is faster since the mask matches more often than the digest. --- diff --git a/src/hb-ot-layout-gpos-table.hh b/src/hb-ot-layout-gpos-table.hh index 4413927..b2b5e9a 100644 --- a/src/hb-ot-layout-gpos-table.hh +++ b/src/hb-ot-layout-gpos-table.hh @@ -1480,8 +1480,8 @@ struct PosLookup : Lookup while (c->buffer->idx < c->buffer->len) { - if ((c->buffer->cur().mask & c->lookup_mask) && - digest->may_have (c->buffer->cur().codepoint) && + if (digest->may_have (c->buffer->cur().codepoint) && + (c->buffer->cur().mask & c->lookup_mask) && apply_once (c)) ret = true; else diff --git a/src/hb-ot-layout-gsub-table.hh b/src/hb-ot-layout-gsub-table.hh index 35d0729..5247c68 100644 --- a/src/hb-ot-layout-gsub-table.hh +++ b/src/hb-ot-layout-gsub-table.hh @@ -1202,8 +1202,8 @@ struct SubstLookup : Lookup while (c->buffer->idx < c->buffer->len) { - if ((c->buffer->cur().mask & c->lookup_mask) && - digest->may_have (c->buffer->cur().codepoint) && + if (digest->may_have (c->buffer->cur().codepoint) && + (c->buffer->cur().mask & c->lookup_mask) && apply_once (c)) ret = true; else @@ -1219,8 +1219,8 @@ struct SubstLookup : Lookup c->buffer->idx = c->buffer->len - 1; do { - if ((c->buffer->cur().mask & c->lookup_mask) && - digest->may_have (c->buffer->cur().codepoint) && + if (digest->may_have (c->buffer->cur().codepoint) && + (c->buffer->cur().mask & c->lookup_mask) && apply_once (c)) ret = true; else