Skip to content

Commit 7f07b4e

Browse files
Im5tukblok
authored andcommitted
Removed couple of common allocations (#794)
1 parent dc19c5d commit 7f07b4e

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

lib/PuppeteerSharp/Helpers/TaskHelper.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ public static class TaskHelper
1616
/// <exception cref="TimeoutException"></exception>
1717
public static async Task CreateTimeoutTask(int timeout)
1818
{
19-
var wrapper = new TaskCompletionSource<bool>();
20-
2119
if (timeout == 0)
2220
{
2321
await Task.Delay(-1).ConfigureAwait(false);

lib/PuppeteerSharp/NavigatorWatcher.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ internal class NavigatorWatcher : IDisposable
1717
[WaitUntilNavigation.Networkidle0] = "networkIdle",
1818
[WaitUntilNavigation.Networkidle2] = "networkAlmostIdle"
1919
};
20+
private static readonly WaitUntilNavigation[] _defaultWaitUntil = new[] { WaitUntilNavigation.Load };
2021

2122
private readonly IConnection _connection;
2223
private readonly NetworkManager _networkManager;
@@ -39,7 +40,7 @@ public NavigatorWatcher(
3940
int timeout,
4041
NavigationOptions options)
4142
{
42-
var waitUntil = new[] { WaitUntilNavigation.Load };
43+
var waitUntil = _defaultWaitUntil;
4344

4445
if (options?.WaitUntil != null)
4546
{

0 commit comments

Comments
 (0)