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:
parent
f9a6110267
commit
0dc3a4e034
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user