MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / singlematch

Function singlematch

deps/lua/src/lstrlib.c:268–275  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

266
267
268static int singlematch (int c, const char *p, const char *ep) {
269 switch (*p) {
270 case '.': return 1; /* matches any char */
271 case L_ESC: return match_class(c, uchar(*(p+1)));
272 case '[': return matchbracketclass(c, p, ep-1);
273 default: return (uchar(*p) == c);
274 }
275}
276
277
278static const char *match (MatchState *ms, const char *s, const char *p);

Callers 3

max_expandFunction · 0.85
min_expandFunction · 0.85
matchFunction · 0.85

Calls 2

match_classFunction · 0.85
matchbracketclassFunction · 0.85

Tested by

no test coverage detected