Simpler loop construct

This commit is contained in:
Ben Adams 2015-10-02 16:56:39 -04:00
parent d61586c6a1
commit 797962b608
1 changed files with 2 additions and 1 deletions

View File

@ -509,9 +509,10 @@ namespace Microsoft.AspNet.Hosting.Startup
private static IEnumerable<Exception> FlattenAndReverseExceptionTree(Exception ex)
{
var list = new List<Exception>();
for (; ex != null; ex = ex.InnerException)
while (ex != null)
{
list.Add(ex);
ex = ex.InnerException;
}
list.Reverse();
return list;