From 8da48913b1c7bcc40e6085394dc39d1efdcc5eef Mon Sep 17 00:00:00 2001
From: "Sven M. Hallberg" <pesco@khjk.org>
Date: Fri, 24 May 2013 01:49:39 +0200
Subject: [PATCH] don't extend table entries that are already unambiguous

---
 src/backends/llk.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/backends/llk.c b/src/backends/llk.c
index 3f3008ea..176541a4 100644
--- a/src/backends/llk.c
+++ b/src/backends/llk.c
@@ -111,6 +111,12 @@ static void stringmap_merge(HHashSet *workset, HCFStringMap *dst, HCFStringMap *
           combine_entries(workset, dst->epsilon_branch, src->epsilon_branch);
     else
       dst->epsilon_branch = src->epsilon_branch;
+  } else {
+    // if there is a non-conflicting value on the left (dst) side, it means
+    // that prediction is already unambiguous. we can drop the right (src)
+    // side we were going to extend with.
+    if(dst->epsilon_branch && dst->epsilon_branch != CONFLICT)
+      return;
   }
 
   if(src->end_branch) {
-- 
GitLab