diff --git a/src/PlaywrightSharp/Frame.cs b/src/PlaywrightSharp/Frame.cs index c5ab81def1..178d793708 100644 --- a/src/PlaywrightSharp/Frame.cs +++ b/src/PlaywrightSharp/Frame.cs @@ -45,16 +45,14 @@ namespace PlaywrightSharp public class Frame : ChannelOwnerBase, IChannelOwner, IFrame { private readonly FrameChannel _channel; - private readonly FrameInitializer _initializer; private readonly List _loadStates = new List(); internal Frame(IChannelOwner parent, string guid, FrameInitializer initializer) : base(parent, guid) { _channel = new FrameChannel(guid, parent.Connection, this); - _initializer = initializer; - Url = _initializer.Url; - Name = _initializer.Name; - ParentFrame = _initializer.ParentFrame; + Url = initializer.Url; + Name = initializer.Name; + ParentFrame = initializer.ParentFrame; _loadStates = initializer.LoadStates; _channel.LoadState += (sender, e) => diff --git a/src/PlaywrightSharp/Helpers/FlexibleStringEnumConverter.cs b/src/PlaywrightSharp/Helpers/FlexibleStringEnumConverter.cs index 1e3f34f521..887322573c 100644 --- a/src/PlaywrightSharp/Helpers/FlexibleStringEnumConverter.cs +++ b/src/PlaywrightSharp/Helpers/FlexibleStringEnumConverter.cs @@ -15,7 +15,6 @@ namespace PlaywrightSharp.Helpers public class FlexibleStringEnumConverter : JsonConverter { private readonly Type _enumType = typeof(T); - private readonly Dictionary _rawToTransformed; private readonly Dictionary _transformedToRaw; private readonly T _default; @@ -29,7 +28,6 @@ public FlexibleStringEnumConverter(T defaultValue) string[] builtInNames = _enumType.GetEnumNames(); var builtInValues = _enumType.GetEnumValues(); - _rawToTransformed = new Dictionary(); _transformedToRaw = new Dictionary(); for (int i = 0; i < builtInNames.Length; i++) @@ -42,7 +40,6 @@ public FlexibleStringEnumConverter(T defaultValue) var enumMemberAttribute = field.GetCustomAttribute(true); string transformedName = enumMemberAttribute?.Value ?? name; - _rawToTransformed[rawValue] = new EnumInfo(transformedName, enumValue, rawValue); _transformedToRaw[transformedName] = new EnumInfo(name, enumValue, rawValue); } } diff --git a/src/PlaywrightSharp/JSHandle.cs b/src/PlaywrightSharp/JSHandle.cs index 6113c12af3..9b525e15cb 100644 --- a/src/PlaywrightSharp/JSHandle.cs +++ b/src/PlaywrightSharp/JSHandle.cs @@ -13,13 +13,11 @@ namespace PlaywrightSharp public class JSHandle : ChannelOwnerBase, IChannelOwner, IJSHandle { private readonly JSHandleChannel _channel; - private readonly JSHandleInitializer _initializer; internal JSHandle(IChannelOwner parent, string guid, JSHandleInitializer initializer) : base(parent, guid) { _channel = new JSHandleChannel(guid, parent.Connection, this); - _initializer = initializer; - Preview = _initializer.Preview; + Preview = initializer.Preview; } /// diff --git a/src/PlaywrightSharp/Transport/StdIOTransport.cs b/src/PlaywrightSharp/Transport/StdIOTransport.cs index f3aaaf3fa9..64e3050723 100644 --- a/src/PlaywrightSharp/Transport/StdIOTransport.cs +++ b/src/PlaywrightSharp/Transport/StdIOTransport.cs @@ -11,7 +11,6 @@ internal class StdIOTransport : IConnectionTransport, IDisposable { private const int DefaultBufferSize = 1024; // Byte buffer size private readonly Process _process; - private readonly ILoggerFactory _loggerFactory; private readonly ILogger _logger; private readonly CancellationTokenSource _readerCancellationSource = new(); private readonly List _data = new(); @@ -20,8 +19,7 @@ internal class StdIOTransport : IConnectionTransport, IDisposable internal StdIOTransport(Process process, ILoggerFactory loggerFactory, TransportTaskScheduler scheduler = null) { _process = process; - _loggerFactory = loggerFactory; - _logger = _loggerFactory?.CreateLogger(); + _logger = loggerFactory?.CreateLogger(); scheduler ??= ScheduleTransportTask; process.ErrorDataReceived += (s, e) => LogReceived?.Invoke(this, new LogReceivedEventArgs(e.Data)); process.BeginErrorReadLine();