]> granicus.if.org Git - re2c/commitdiff
Use a specialized simplified version of POSIX comparison for initial configurations.
authorUlya Trofimovich <skvadrik@gmail.com>
Wed, 2 Jan 2019 17:43:17 +0000 (17:43 +0000)
committerUlya Trofimovich <skvadrik@gmail.com>
Wed, 2 Jan 2019 17:43:17 +0000 (17:43 +0000)
re2c/src/dfa/closure_posix.cc

index 8d5203333fb371bf8929c30e22e695a117b55a84..96843f547017e9f365fa0578bfecdff86d95cb0d 100644 (file)
@@ -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;
 }
 
 /*