Obssesive optimization

Not measurable by any means, but conceptually this is faster since
the mask matches more often than the digest.
This commit is contained in:
Behdad Esfahbod 2013-04-17 23:04:03 -04:00
parent f9a6110267
commit 0dc3a4e034
2 changed files with 6 additions and 6 deletions

View File

@ -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

View File

@ -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