Commit 9f2a65c 1 parent c1dc9ec commit 9f2a65c Copy full SHA for 9f2a65c
File tree 1 file changed +3
-4
lines changed
src/NUnitCommon/nunit.agent.core
1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -49,11 +49,10 @@ public AgentOptions(params string[] args)
49
49
val = option . Substring ( delim + 1 ) ;
50
50
}
51
51
52
- if ( ! VALID_OPTIONS . ContainsKey ( opt ) )
52
+ // Simultaneously check that the option is valid and determine if it takes an argument
53
+ if ( ! VALID_OPTIONS . TryGetValue ( opt , out bool optionTakesValue ) )
53
54
throw new Exception ( $ "Invalid argument: { arg } ") ;
54
55
55
- bool optionTakesValue = VALID_OPTIONS [ opt ] ;
56
-
57
56
if ( optionTakesValue )
58
57
{
59
58
if ( val == null && index + 1 < args . Length )
@@ -119,7 +118,7 @@ string GetArgumentValue(string argument)
119
118
120
119
private static bool IsOption ( string arg )
121
120
{
122
- return arg . StartsWith ( "--" ) ;
121
+ return arg . StartsWith ( "--" , StringComparison . Ordinal ) ;
123
122
}
124
123
}
125
124
}
You can’t perform that action at this time.
0 commit comments