Use concrete types when possible for improved performance
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user