Skip to content

Commit

Permalink
Improve code quality
Browse files Browse the repository at this point in the history
  • Loading branch information
tamasvajk committed Jul 3, 2024
1 parent b36db5a commit 6a036f4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions csharp/extractor/Semmle.Extraction/FilePattern.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,15 @@ private static StringBuilder BuildRegex(string pattern)
if (i + 2 < pattern.Length)
{
// Processing .../**/...
// ^^^
sb.Append("(.*/|)");
i += 3;
}
else
{
// Processing .../**
sb.Append(".*");
// There's no need to add another .* to the end outside the loop, we can return early.
return sb;
// Processing .../** at the end of the pattern.
// There's no need to add .* because it's anyways added outside the loop.
break;
}
}
else
Expand Down

0 comments on commit 6a036f4

Please sign in to comment.