Simpler loop construct
This commit is contained in:
parent
d61586c6a1
commit
797962b608
|
|
@ -509,9 +509,10 @@ namespace Microsoft.AspNet.Hosting.Startup
|
||||||
private static IEnumerable<Exception> FlattenAndReverseExceptionTree(Exception ex)
|
private static IEnumerable<Exception> FlattenAndReverseExceptionTree(Exception ex)
|
||||||
{
|
{
|
||||||
var list = new List<Exception>();
|
var list = new List<Exception>();
|
||||||
for (; ex != null; ex = ex.InnerException)
|
while (ex != null)
|
||||||
{
|
{
|
||||||
list.Add(ex);
|
list.Add(ex);
|
||||||
|
ex = ex.InnerException;
|
||||||
}
|
}
|
||||||
list.Reverse();
|
list.Reverse();
|
||||||
return list;
|
return list;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue