Use Dictionary constructor where allowed

This commit is contained in:
Sam Harwell 2013-02-27 16:27:08 -06:00
parent 59583da8b0
commit 3d5f7664c6
1 changed files with 4 additions and 0 deletions

View File

@ -290,7 +290,11 @@ namespace Antlr4.Runtime.Dfa
}
else
{
#if NET_4_5
Dictionary<int, DFAState> result = map.ToDictionary(i => i.Key, i => i.Value);
#else
Dictionary<int, DFAState> result = new Dictionary<int, DFAState>(map);
#endif
result.Add(PredictionContext.EmptyFullStateKey, result[-1]);
result.Remove(-1);
#if NET_4_5