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)
|
while (c->buffer->idx < c->buffer->len)
|
||||||
{
|
{
|
||||||
if ((c->buffer->cur().mask & c->lookup_mask) &&
|
if (digest->may_have (c->buffer->cur().codepoint) &&
|
||||||
digest->may_have (c->buffer->cur().codepoint) &&
|
(c->buffer->cur().mask & c->lookup_mask) &&
|
||||||
apply_once (c))
|
apply_once (c))
|
||||||
ret = true;
|
ret = true;
|
||||||
else
|
else
|
||||||
|
|
|
@ -1202,8 +1202,8 @@ struct SubstLookup : Lookup
|
||||||
|
|
||||||
while (c->buffer->idx < c->buffer->len)
|
while (c->buffer->idx < c->buffer->len)
|
||||||
{
|
{
|
||||||
if ((c->buffer->cur().mask & c->lookup_mask) &&
|
if (digest->may_have (c->buffer->cur().codepoint) &&
|
||||||
digest->may_have (c->buffer->cur().codepoint) &&
|
(c->buffer->cur().mask & c->lookup_mask) &&
|
||||||
apply_once (c))
|
apply_once (c))
|
||||||
ret = true;
|
ret = true;
|
||||||
else
|
else
|
||||||
|
@ -1219,8 +1219,8 @@ struct SubstLookup : Lookup
|
||||||
c->buffer->idx = c->buffer->len - 1;
|
c->buffer->idx = c->buffer->len - 1;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if ((c->buffer->cur().mask & c->lookup_mask) &&
|
if (digest->may_have (c->buffer->cur().codepoint) &&
|
||||||
digest->may_have (c->buffer->cur().codepoint) &&
|
(c->buffer->cur().mask & c->lookup_mask) &&
|
||||||
apply_once (c))
|
apply_once (c))
|
||||||
ret = true;
|
ret = true;
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue