From 7608cb37ab798db49f33f3870f2f84fbe0809266 Mon Sep 17 00:00:00 2001 From: Marco Carvalho Date: Thu, 22 Jun 2023 20:37:25 -0300 Subject: [PATCH] "Exists" method should be used instead of the "Any" extension (#5345) --- src/Ryujinx.Graphics.Gpu/Image/TextureGroupHandle.cs | 2 +- src/Ryujinx.Graphics.Vulkan/ShaderCollection.cs | 2 +- src/Ryujinx.HLE/HOS/Kernel/Threading/KAddressArbiter.cs | 2 +- src/Ryujinx.HLE/HOS/Services/Nfc/Nfp/VirtualAmiibo.cs | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Ryujinx.Graphics.Gpu/Image/TextureGroupHandle.cs b/src/Ryujinx.Graphics.Gpu/Image/TextureGroupHandle.cs index fd66269d..da8dd849 100644 --- a/src/Ryujinx.Graphics.Gpu/Image/TextureGroupHandle.cs +++ b/src/Ryujinx.Graphics.Gpu/Image/TextureGroupHandle.cs @@ -512,7 +512,7 @@ namespace Ryujinx.Graphics.Gpu.Image /// True if at least one of the handles is dirty private bool CheckDirty() { - return Handles.Any(handle => handle.Dirty); + return Array.Exists(Handles, handle => handle.Dirty); } /// diff --git a/src/Ryujinx.Graphics.Vulkan/ShaderCollection.cs b/src/Ryujinx.Graphics.Vulkan/ShaderCollection.cs index 222cdf2a..2a3f8657 100644 --- a/src/Ryujinx.Graphics.Vulkan/ShaderCollection.cs +++ b/src/Ryujinx.Graphics.Vulkan/ShaderCollection.cs @@ -256,7 +256,7 @@ namespace Ryujinx.Graphics.Vulkan { await Task.WhenAll(_shaders.Select(shader => shader.CompileTask)); - if (_shaders.Any(shader => shader.CompileStatus == ProgramLinkStatus.Failure)) + if (Array.Exists(_shaders, shader => shader.CompileStatus == ProgramLinkStatus.Failure)) { LinkStatus = ProgramLinkStatus.Failure; diff --git a/src/Ryujinx.HLE/HOS/Kernel/Threading/KAddressArbiter.cs b/src/Ryujinx.HLE/HOS/Kernel/Threading/KAddressArbiter.cs index 74867b44..57fbabd5 100644 --- a/src/Ryujinx.HLE/HOS/Kernel/Threading/KAddressArbiter.cs +++ b/src/Ryujinx.HLE/HOS/Kernel/Threading/KAddressArbiter.cs @@ -206,7 +206,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading WakeThreads(_condVarThreads, count, TryAcquireMutex, x => x.CondVarAddress == address); - if (!_condVarThreads.Any(x => x.CondVarAddress == address)) + if (!_condVarThreads.Exists(x => x.CondVarAddress == address)) { KernelTransfer.KernelToUser(address, 0); } diff --git a/src/Ryujinx.HLE/HOS/Services/Nfc/Nfp/VirtualAmiibo.cs b/src/Ryujinx.HLE/HOS/Services/Nfc/Nfp/VirtualAmiibo.cs index 9166e87f..9e1db7fc 100644 --- a/src/Ryujinx.HLE/HOS/Services/Nfc/Nfp/VirtualAmiibo.cs +++ b/src/Ryujinx.HLE/HOS/Services/Nfc/Nfp/VirtualAmiibo.cs @@ -95,7 +95,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.Nfp { VirtualAmiiboFile virtualAmiiboFile = LoadAmiiboFile(amiiboId); - if (virtualAmiiboFile.ApplicationAreas.Any(item => item.ApplicationAreaId == applicationAreaId)) + if (virtualAmiiboFile.ApplicationAreas.Exists(item => item.ApplicationAreaId == applicationAreaId)) { _openedApplicationAreaId = applicationAreaId; @@ -124,7 +124,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.Nfp { VirtualAmiiboFile virtualAmiiboFile = LoadAmiiboFile(amiiboId); - if (virtualAmiiboFile.ApplicationAreas.Any(item => item.ApplicationAreaId == applicationAreaId)) + if (virtualAmiiboFile.ApplicationAreas.Exists(item => item.ApplicationAreaId == applicationAreaId)) { return false; } @@ -144,7 +144,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.Nfp { VirtualAmiiboFile virtualAmiiboFile = LoadAmiiboFile(amiiboId); - if (virtualAmiiboFile.ApplicationAreas.Any(item => item.ApplicationAreaId == _openedApplicationAreaId)) + if (virtualAmiiboFile.ApplicationAreas.Exists(item => item.ApplicationAreaId == _openedApplicationAreaId)) { for (int i = 0; i < virtualAmiiboFile.ApplicationAreas.Count; i++) {