private Automaton ToAutomatonAllowMutate(IDictionary <string, Automaton> automata, IAutomatonProvider automaton_provider) { bool b = false; if (allow_mutation) // thread unsafe { b = Automaton.SetAllowMutate(true); } Automaton a = ToAutomaton(automata, automaton_provider); if (allow_mutation) { Automaton.SetAllowMutate(b); } return(a); }