diff --git a/BizHawk.Client.EmuHawk/GraphicsImplementations/IGL_GdiPlus.cs b/BizHawk.Client.EmuHawk/GraphicsImplementations/IGL_GdiPlus.cs index 5f8a9adf51..957cc512a2 100644 --- a/BizHawk.Client.EmuHawk/GraphicsImplementations/IGL_GdiPlus.cs +++ b/BizHawk.Client.EmuHawk/GraphicsImplementations/IGL_GdiPlus.cs @@ -319,8 +319,7 @@ namespace BizHawk.Client.EmuHawk refGraphics = Graphics.FromImage(tw.SDBitmap); } - if (MyBufferedGraphics != null) - MyBufferedGraphics.Dispose(); + MyBufferedGraphics?.Dispose(); MyBufferedGraphics = Gdi.MyBufferedGraphicsContext.Allocate(refGraphics, r); //MyBufferedGraphics.Graphics.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.HighSpeed; diff --git a/BizHawk.Client.EmuHawk/GraphicsImplementations/IGL_SlimDX9.cs b/BizHawk.Client.EmuHawk/GraphicsImplementations/IGL_SlimDX9.cs index 87aaaaa511..8991f90af2 100644 --- a/BizHawk.Client.EmuHawk/GraphicsImplementations/IGL_SlimDX9.cs +++ b/BizHawk.Client.EmuHawk/GraphicsImplementations/IGL_SlimDX9.cs @@ -522,8 +522,8 @@ namespace BizHawk.Client.EmuHawk { var sw = shader.Opaque as ShaderWrapper; sw.bytecode.Dispose(); - if (sw.ps != null) sw.ps.Dispose(); - if (sw.vs != null) sw.vs.Dispose(); + sw.ps?.Dispose(); + sw.vs?.Dispose(); } class UniformWrapper diff --git a/BizHawk.Client.EmuHawk/GraphicsImplementations/RetainedGraphicsControl.cs b/BizHawk.Client.EmuHawk/GraphicsImplementations/RetainedGraphicsControl.cs index 43d7fee9d1..e0e50de6e2 100644 --- a/BizHawk.Client.EmuHawk/GraphicsImplementations/RetainedGraphicsControl.cs +++ b/BizHawk.Client.EmuHawk/GraphicsImplementations/RetainedGraphicsControl.cs @@ -53,8 +53,7 @@ namespace BizHawk.Client.EmuHawk if (_retain) { //TODO - frugalize me - if (rt != null) - rt.Dispose(); + rt?.Dispose(); rt = GL.CreateRenderTarget(Width, Height); rt.Bind(); } diff --git a/BizHawk.Client.EmuHawk/Sound/Utilities/BufferedAsync.cs b/BizHawk.Client.EmuHawk/Sound/Utilities/BufferedAsync.cs index 4718c563a7..345f804c38 100644 --- a/BizHawk.Client.EmuHawk/Sound/Utilities/BufferedAsync.cs +++ b/BizHawk.Client.EmuHawk/Sound/Utilities/BufferedAsync.cs @@ -53,9 +53,7 @@ namespace BizHawk.Client.EmuHawk public void DiscardSamples() { buffer.Clear(); - - if (BaseSoundProvider != null) - BaseSoundProvider.DiscardSamples(); + BaseSoundProvider?.DiscardSamples(); } /// . is not diff --git a/BizHawk.Client.EmuHawk/Sound/Utilities/SoundOutputProvider.cs b/BizHawk.Client.EmuHawk/Sound/Utilities/SoundOutputProvider.cs index fa096d6601..bdc5c7bf88 100644 --- a/BizHawk.Client.EmuHawk/Sound/Utilities/SoundOutputProvider.cs +++ b/BizHawk.Client.EmuHawk/Sound/Utilities/SoundOutputProvider.cs @@ -94,10 +94,7 @@ namespace BizHawk.Client.EmuHawk _resampleBuffer = new short[0]; _resampleLengthRoundingError = 0.0; - if (BaseSoundProvider != null) - { - BaseSoundProvider.DiscardSamples(); - } + BaseSoundProvider?.DiscardSamples(); } private void ResetBuffer() diff --git a/BizHawk.Client.EmuHawk/config/FirmwaresConfig.cs b/BizHawk.Client.EmuHawk/config/FirmwaresConfig.cs index 59cc518a3a..c43219c7b2 100644 --- a/BizHawk.Client.EmuHawk/config/FirmwaresConfig.cs +++ b/BizHawk.Client.EmuHawk/config/FirmwaresConfig.cs @@ -335,8 +335,7 @@ namespace BizHawk.Client.EmuHawk foreach (var fr in FirmwareDatabase.FirmwareRecords) { var ri = Manager.Resolve(fr); - if (ri == null) continue; - if (ri.KnownFirmwareFile == null) continue; + if (ri?.KnownFirmwareFile == null) continue; if (ri.UserSpecified) continue; string fpTarget = PathManager.StandardFirmwareName(ri.KnownFirmwareFile.RecommendedName);