Skip to content

Commit 2d2e422

Browse files
committed
.* and .+ opt not .
1 parent 4c92447 commit 2d2e422

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/ugrep.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8435,18 +8435,18 @@ void ugrep()
84358435
}
84368436
}
84378437

8438-
// patterns .*, . and .+ are easy special cases to optimize for search
8438+
// patterns .* and .+ are common easy special cases to optimize for search
84398439
if (!flag_fixed_strings && !flag_dotall && Static::bcnf.singleton_or_undefined())
84408440
{
84418441
if (regex == ".*")
84428442
{
84438443
flag_match = true;
8444+
flag_empty = true;
84448445
regex.clear();
84458446
}
8446-
else if (regex == "." || regex == ".+")
8447+
else if (regex == ".+")
84478448
{
84488449
flag_match = true;
8449-
flag_empty = false;
84508450
regex.clear();
84518451
}
84528452
}

0 commit comments

Comments
 (0)