Use Null-Propagation Operator

This commit is contained in:
teinarss
2020-08-16 11:38:14 +02:00
committed by Paul Chote
parent 8d27d22100
commit 9c4fd0e3d3
113 changed files with 219 additions and 464 deletions

View File

@@ -88,8 +88,7 @@ namespace OpenRA
if (sounds != null)
foreach (var soundSource in sounds.Values)
if (soundSource != null)
soundSource.Dispose();
soundSource?.Dispose();
this.loaders = loaders;
this.fileSystem = fileSystem;
@@ -430,8 +429,8 @@ namespace OpenRA
StopAudio();
if (sounds != null)
foreach (var soundSource in sounds.Values)
if (soundSource != null)
soundSource.Dispose();
soundSource?.Dispose();
soundEngine.Dispose();
}
}