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 19
19
using namespace llvm ;
20
20
using namespace lld ;
21
21
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) {
26
30
ExactPattern = Pattern.substr (1 , Pattern.size () - 2 );
27
31
} else {
28
32
Expected<GlobPattern> Glob = GlobPattern::create (Pattern);
29
33
if (!Glob) {
30
34
error (toString (Glob.takeError ()) + " : " + Pattern);
31
35
return ;
32
36
}
33
- ExactMatch = false ;
34
37
GlobPatternMatcher = *Glob;
35
38
}
36
39
}
You can’t perform that action at this time.
0 commit comments