Change to use pattern matching
This commit is contained in:
@@ -63,13 +63,11 @@ namespace OpenRA
|
||||
|
||||
sb.AppendIndentedFormatLine(indent, "Exception of type `{0}`: {1}", ex.GetType().FullName, ex.Message);
|
||||
|
||||
var tle = ex as TypeLoadException;
|
||||
var oom = ex as OutOfMemoryException;
|
||||
if (tle != null)
|
||||
if (ex is TypeLoadException tle)
|
||||
{
|
||||
sb.AppendIndentedFormatLine(indent, "TypeName=`{0}`", tle.TypeName);
|
||||
}
|
||||
else if (oom != null)
|
||||
else if (ex is OutOfMemoryException)
|
||||
{
|
||||
var gcMemoryBeforeCollect = GC.GetTotalMemory(false);
|
||||
GC.Collect();
|
||||
|
||||
Reference in New Issue
Block a user