Skip to content

Commit a1eeccb

Browse files
committed
use icmp instead of toUpper in getopt
1 parent 74a40f4 commit a1eeccb

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

std/getopt.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,7 +1108,7 @@ private bool optMatch(string arg, scope string optPattern, ref string value,
11081108
{
11091109
import std.algorithm.iteration : splitter;
11101110
import std.string : indexOf;
1111-
import std.uni : toUpper;
1111+
import std.uni : icmp;
11121112
//writeln("optMatch:\n ", arg, "\n ", optPattern, "\n ", value);
11131113
//scope(success) writeln("optMatch result: ", value);
11141114
if (arg.length < 2 || arg[0] != optionChar) return false;
@@ -1151,7 +1151,7 @@ private bool optMatch(string arg, scope string optPattern, ref string value,
11511151
foreach (v; splitter(optPattern, "|"))
11521152
{
11531153
//writeln("Trying variant: ", v, " against ", arg);
1154-
if (arg == v || !cfg.caseSensitive && toUpper(arg) == toUpper(v))
1154+
if (arg == v || (!cfg.caseSensitive && icmp(arg, v) == 0))
11551155
return true;
11561156
if (cfg.bundling && !isLong && v.length == 1
11571157
&& indexOf(arg, v) >= 0)

0 commit comments

Comments
 (0)