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

Method ReverseProg

extern/re2/re2/re2.cc:247–262  ·  view source on GitHub ↗

Returns rprog_, computing it if needed.

Source from the content-addressed store, hash-verified

245
246// Returns rprog_, computing it if needed.
247re2::Prog* RE2::ReverseProg() const {
248 std::call_once(rprog_once_, [](const RE2* re) {
249 re->rprog_ =
250 re->suffix_regexp_->CompileToReverseProg(re->options_.max_mem() / 3);
251 if (re->rprog_ == NULL) {
252 if (re->options_.log_errors())
253 LOG(ERROR) << "Error reverse compiling '" << trunc(re->pattern_) << "'";
254 // We no longer touch error_ and error_code_ because failing to compile
255 // the reverse Prog is not a showstopper: falling back to NFA execution
256 // is fine. More importantly, an RE2 object is supposed to be logically
257 // immutable: whatever ok() would have returned after Init() completed,
258 // it should continue to return that no matter what ReverseProg() does.
259 }
260 }, this);
261 return rprog_;
262}
263
264RE2::~RE2() {
265 if (suffix_regexp_)

Callers

nothing calls this directly

Calls 5

CompileToReverseProgMethod · 0.80
max_memMethod · 0.80
log_errorsMethod · 0.80
truncFunction · 0.70
call_onceFunction · 0.50

Tested by

no test coverage detected