From d9d1a98751c40303ec9455a21044256a8d43e580 Mon Sep 17 00:00:00 2001 From: Ulya Trofimovich Date: Wed, 2 Jan 2019 17:43:17 +0000 Subject: [PATCH] Use a specialized simplified version of POSIX comparison for initial configurations. --- re2c/src/dfa/closure_posix.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/re2c/src/dfa/closure_posix.cc b/re2c/src/dfa/closure_posix.cc index 8d520333..96843f54 100644 --- a/re2c/src/dfa/closure_posix.cc +++ b/re2c/src/dfa/closure_posix.cc @@ -144,8 +144,13 @@ inline cmp_gor1_t::cmp_gor1_t(determ_context_t &c) : ctx(c) {} inline bool cmp_gor1_t::operator()(const clos_t &x, const clos_t &y) const { - int32_t h1, h2; - return precedence(ctx, x, y, h1, h2) < 0; + const kernel_t *k = ctx.dc_kernels[ctx.dc_origin]; + const uint32_t xo = x.origin, yo = y.origin; + + DASSERT(xo != yo && x.tlook == HROOT && y.tlook == HROOT); + + // if longest components differ, leftmost already incorporates that + return unpack_leftmost(k->prectbl[xo * k->size + yo]) < 0; } /* -- 2.40.0