File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change 1919using namespace llvm ;
2020using namespace lld ;
2121
22- SingleStringMatcher::SingleStringMatcher (StringRef Pattern) {
23- if (Pattern.size () > 2 && Pattern.starts_with (" \" " ) &&
24- Pattern.ends_with (" \" " )) {
25- ExactMatch = true ;
22+ static bool isExact (StringRef Pattern) {
23+ return Pattern.size () > 2 && Pattern.starts_with (" \" " ) &&
24+ Pattern.ends_with (" \" " );
25+ }
26+
27+ SingleStringMatcher::SingleStringMatcher (StringRef Pattern)
28+ : ExactMatch(isExact(Pattern)) {
29+ if (ExactMatch) {
2630 ExactPattern = Pattern.substr (1 , Pattern.size () - 2 );
2731 } else {
2832 Expected<GlobPattern> Glob = GlobPattern::create (Pattern);
2933 if (!Glob) {
3034 error (toString (Glob.takeError ()) + " : " + Pattern);
3135 return ;
3236 }
33- ExactMatch = false ;
3437 GlobPatternMatcher = *Glob;
3538 }
3639}
You can’t perform that action at this time.
0 commit comments