icsharpcode/ILSpy

foreach expected but while used instead

Open

#1.603 aberto em 29 de jul. de 2019

Ver no GitHub
 (3 comments) (0 reactions) (0 assignees)C# (3.645 forks)batch import
C#DecompilerEnhancementHelp Wanted

Métricas do repositório

Stars
 (25.162 stars)
Métricas de merge de PR
 (Mesclagem média 15d 22h) (61 fundiu PRs em 30d)

Description

ILSpy version 5.0.0.4970-preview3

method decompiled with while but foreach expected

protected CompositeDevices(SerializationInfo info, StreamingContext context)
	: base(info, context)
{
	SerializationInfoEnumerator enumerator = info.GetEnumerator();
	while (enumerator.MoveNext())
	{
		string name = enumerator.Current.Name;
		if (name != null && name == "AdditionalParameters")
		{
			AdditionalParameters = (Dictionary<string, string>)info.GetValue("AdditionalParameters", typeof(Dictionary<string, string>));
		}
	}
	base.CollectionChanged += OnCollectionChanged;
}

please also ref to very similar method CompositeDevices(IEnumerable col) that decompiled to foreach!

target: #1601

PS this assemlby has a lot of other locations that are decompiled to while loop instead of much more expected foreach!

Guia do colaborador