Emuation.DiscSystem - cleanup - use null propagation
This commit is contained in:
parent
03ccdb15eb
commit
eb4acc0090
|
@ -109,10 +109,9 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
{
|
||||
// Parse this node
|
||||
if (child.Key != ISONodeRecord.CURRENT_DIRECTORY &&
|
||||
child.Key != ISONodeRecord.PARENT_DIRECTORY &&
|
||||
child.Value is ISODirectoryNode)
|
||||
child.Key != ISONodeRecord.PARENT_DIRECTORY)
|
||||
{
|
||||
((ISODirectoryNode)child.Value).Parse(s, visited);
|
||||
(child.Value as ISODirectoryNode)?.Parse(s, visited);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -146,10 +145,9 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
ISONode n = this.Children[s];
|
||||
Console.WriteLine(tabs + s);
|
||||
if (s != ISONodeRecord.CURRENT_DIRECTORY &&
|
||||
s != ISONodeRecord.PARENT_DIRECTORY &&
|
||||
n is ISODirectoryNode)
|
||||
s != ISONodeRecord.PARENT_DIRECTORY)
|
||||
{
|
||||
((ISODirectoryNode)n).Print(depth + 1);
|
||||
(n as ISODirectoryNode)?.Print(depth + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,8 +40,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
|
||||
public void Dispose()
|
||||
{
|
||||
if(stream != null)
|
||||
stream.Dispose();
|
||||
stream?.Dispose();
|
||||
stream = null;
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
|
||||
public void Dispose()
|
||||
{
|
||||
if (BaseStream != null) BaseStream.Dispose();
|
||||
BaseStream?.Dispose();
|
||||
BaseStream = null;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue