Use concrete types when possible for improved performance

This commit is contained in:
Marco Carvalho
2025-01-05 11:54:53 -03:00
parent 850df38f1e
commit c80c397967
45 changed files with 150 additions and 171 deletions

View File

@@ -12,8 +12,8 @@ namespace Ryujinx.Common.SystemInterop
public partial class StdErrAdapter : IDisposable
{
private bool _disposable;
private Stream _pipeReader;
private Stream _pipeWriter;
private FileStream _pipeReader;
private FileStream _pipeWriter;
private CancellationTokenSource _cancellationTokenSource;
private Task _worker;
@@ -46,7 +46,7 @@ namespace Ryujinx.Common.SystemInterop
[SupportedOSPlatform("macos")]
private async Task EventWorkerAsync(CancellationToken cancellationToken)
{
using TextReader reader = new StreamReader(_pipeReader, leaveOpen: true);
using StreamReader reader = new StreamReader(_pipeReader, leaveOpen: true);
string line;
while (cancellationToken.IsCancellationRequested == false && (line = await reader.ReadLineAsync(cancellationToken)) != null)
{
@@ -92,7 +92,7 @@ namespace Ryujinx.Common.SystemInterop
[SupportedOSPlatform("linux")]
[SupportedOSPlatform("macos")]
private static Stream CreateFileDescriptorStream(int fd)
private static FileStream CreateFileDescriptorStream(int fd)
{
return new FileStream(
new SafeFileHandle(fd, ownsHandle: true),