diff Implab/Parsing/EDFADefinition.cs @ 160:5802131432e4 v2

fixed regression: race condition in Promise DFA refactoring
author cin
date Thu, 18 Feb 2016 19:38:54 +0300
parents 130781364799
children
line wrap: on
line diff
--- a/Implab/Parsing/EDFADefinition.cs	Thu Feb 18 16:06:14 2016 +0300
+++ b/Implab/Parsing/EDFADefinition.cs	Thu Feb 18 19:38:54 2016 +0300
@@ -18,10 +18,8 @@
         }
 
         public EDFADefinition<T> Optimize() {
-            var optimized = new EDFADefinition<T>(new EnumAlphabet<T>());
-            Optimize(optimized, m_alphabet, optimized.Alphabet);
-
-            return optimized;
+            
+            return (EDFADefinition<T>)Optimize(alphabet => new EDFADefinition<T>((EnumAlphabet<T>)alphabet), m_alphabet, new EnumAlphabet<T>());
         }
 
         public void PrintDFA() {