Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(57)

Unified Diff: third_party/re2/re2/compile.cc

Issue 1096813007: third_party/re2: Remove remove-static-initializers.patch. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rm the patch files and update the README file Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/re2/re2/compile.cc
diff --git a/third_party/re2/re2/compile.cc b/third_party/re2/re2/compile.cc
index 14e401afc55a547acf9d799702c33bde8fc25630..9a59f1354473edbbafe58ea7f437b921ff815383 100644
--- a/third_party/re2/re2/compile.cc
+++ b/third_party/re2/re2/compile.cc
@@ -110,10 +110,6 @@ struct Frag {
Frag(uint32 begin, PatchList end) : begin(begin), end(end) {}
};
-static Frag NullFrag() {
- return Frag();
-}
-
// Input encodings.
enum Encoding {
kEncodingUTF8 = 1, // UTF-8 (0-10FFFF)
@@ -685,13 +681,13 @@ Frag Compiler::PreVisit(Regexp* re, Frag, bool* stop) {
if (failed_)
*stop = true;
- return NullFrag(); // not used by caller
+ return Frag(); // not used by caller
}
Frag Compiler::Literal(Rune r, bool foldcase) {
switch (encoding_) {
default:
- return NullFrag();
+ return Frag();
case kEncodingLatin1:
return ByteRange(r, r, foldcase);
@@ -1007,7 +1003,7 @@ Prog* Compiler::Compile(Regexp* re, bool reversed, int64 max_mem) {
bool is_anchor_end = IsAnchorEnd(&sre, 0);
// Generate fragment for entire regexp.
- Frag f = c.WalkExponential(sre, NullFrag(), 2*c.max_inst_);
+ Frag f = c.WalkExponential(sre, Frag(), 2*c.max_inst_);
sre->Decref();
if (c.failed_)
return NULL;
@@ -1098,7 +1094,7 @@ Prog* Compiler::CompileSet(const RE2::Options& options, RE2::Anchor anchor,
c.Setup(pf, options.max_mem(), anchor);
// Compile alternation of fragments.
- Frag all = c.WalkExponential(re, NullFrag(), 2*c.max_inst_);
+ Frag all = c.WalkExponential(re, Frag(), 2*c.max_inst_);
re->Decref();
if (c.failed_)
return NULL;

Powered by Google App Engine
This is Rietveld 408576698