Przeglądaj źródła

Do not compare Span<T> to 'null' or 'default' (#6683)

Marco Carvalho 2 lat temu
rodzic
commit
99f46e22e2

+ 2 - 2
src/Ryujinx.Graphics.Vulkan/CommandBufferPool.cs

@@ -302,12 +302,12 @@ namespace Ryujinx.Graphics.Vulkan
                         SubmitInfo sInfo = new()
                         SubmitInfo sInfo = new()
                         {
                         {
                             SType = StructureType.SubmitInfo,
                             SType = StructureType.SubmitInfo,
-                            WaitSemaphoreCount = waitSemaphores != null ? (uint)waitSemaphores.Length : 0,
+                            WaitSemaphoreCount = !waitSemaphores.IsEmpty ? (uint)waitSemaphores.Length : 0,
                             PWaitSemaphores = pWaitSemaphores,
                             PWaitSemaphores = pWaitSemaphores,
                             PWaitDstStageMask = pWaitDstStageMask,
                             PWaitDstStageMask = pWaitDstStageMask,
                             CommandBufferCount = 1,
                             CommandBufferCount = 1,
                             PCommandBuffers = &commandBuffer,
                             PCommandBuffers = &commandBuffer,
-                            SignalSemaphoreCount = signalSemaphores != null ? (uint)signalSemaphores.Length : 0,
+                            SignalSemaphoreCount = !signalSemaphores.IsEmpty ? (uint)signalSemaphores.Length : 0,
                             PSignalSemaphores = pSignalSemaphores,
                             PSignalSemaphores = pSignalSemaphores,
                         };
                         };
 
 

+ 1 - 1
src/Ryujinx.HLE/HOS/Services/Fatal/IService.cs

@@ -60,7 +60,7 @@ namespace Ryujinx.HLE.HOS.Services.Fatal
             errorReport.AppendLine($"\tResultCode: {((int)resultCode & 0x1FF) + 2000}-{((int)resultCode >> 9) & 0x3FFF:d4}");
             errorReport.AppendLine($"\tResultCode: {((int)resultCode & 0x1FF) + 2000}-{((int)resultCode >> 9) & 0x3FFF:d4}");
             errorReport.AppendLine($"\tFatalPolicy: {fatalPolicy}");
             errorReport.AppendLine($"\tFatalPolicy: {fatalPolicy}");
 
 
-            if (cpuContext != null)
+            if (!cpuContext.IsEmpty)
             {
             {
                 errorReport.AppendLine("CPU Context:");
                 errorReport.AppendLine("CPU Context:");