MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / Simplify

Method Simplify

extern/re2/re2/simplify.cc:177–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

175// Caller must Decref() return value when done with it.
176
177Regexp* Regexp::Simplify() {
178 CoalesceWalker cw;
179 Regexp* cre = cw.Walk(this, NULL);
180 if (cre == NULL)
181 return NULL;
182 if (cw.stopped_early()) {
183 cre->Decref();
184 return NULL;
185 }
186 SimplifyWalker sw;
187 Regexp* sre = sw.Walk(cre, NULL);
188 cre->Decref();
189 if (sre == NULL)
190 return NULL;
191 if (sw.stopped_early()) {
192 sre->Decref();
193 return NULL;
194 }
195 return sre;
196}
197
198#define Simplify DontCallSimplify // Avoid accidental recursion
199

Callers 6

CompileMethod · 0.45
CompileSetMethod · 0.45
SimplifyRegexpMethod · 0.45
TESTFunction · 0.45
SimplifyRegexpFunction · 0.45
SimplifyCompileRegexpFunction · 0.45

Calls 3

WalkMethod · 0.80
stopped_earlyMethod · 0.80
DecrefMethod · 0.45

Tested by 1

TESTFunction · 0.36