MCPcopy Create free account
hub / github.com/async-profiler/async-profiler / Matcher

Method Matcher

src/frameName.cpp:21–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19
20
21Matcher::Matcher(const char* pattern) {
22 if (pattern[0] == '*') {
23 _type = MATCH_ENDS_WITH;
24 _pattern = strdup(pattern + 1);
25 } else {
26 _type = MATCH_EQUALS;
27 _pattern = strdup(pattern);
28 }
29
30 _len = strlen(_pattern);
31 if (_len > 0 && _pattern[_len - 1] == '*') {
32 _type = _type == MATCH_EQUALS ? MATCH_STARTS_WITH : MATCH_CONTAINS;
33 _pattern[--_len] = 0;
34 }
35}
36
37Matcher::~Matcher() {
38 free(_pattern);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected