Skip to content

Commit 0579687

Browse files
authored
[dotnet] Small performance improvement for DriverFactory (#12497)
Small performance improvement for DriverFactory I noticed in 962a34b that an `if`-statement was used, while probably an `else-if` should have been used, to skip all other conditions when the Chrome driver is used.
1 parent 72f083c commit 0579687

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dotnet/test/common/Environment/DriverFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public IWebDriver CreateDriverWithOptions(Type driverType, DriverOptions driverO
4646
browser = Browser.Chrome;
4747
options = GetDriverOptions<ChromeOptions>(driverType, driverOptions);
4848
}
49-
if (typeof(EdgeDriver).IsAssignableFrom(driverType))
49+
else if (typeof(EdgeDriver).IsAssignableFrom(driverType))
5050
{
5151
browser = Browser.Edge;
5252
options = GetDriverOptions<EdgeOptions>(driverType, driverOptions);

0 commit comments

Comments
 (0)