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

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

Issue 1530113002: Revert of Update re2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « third_party/re2/re2/prefilter.h ('k') | third_party/re2/re2/prefilter_tree.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/re2/re2/prefilter.cc
diff --git a/third_party/re2/re2/prefilter.cc b/third_party/re2/re2/prefilter.cc
index 45e43c9c095a251993f7eaa95ca242e007fefb5e..77e0cbd0968ae8badd78a2c658eed5e0a4bb3e4a 100644
--- a/third_party/re2/re2/prefilter.cc
+++ b/third_party/re2/re2/prefilter.cc
@@ -15,7 +15,6 @@
typedef set<string>::iterator SSIter;
typedef set<string>::const_iterator ConstSSIter;
-GLOBAL_MUTEX(alloc_id_mutex);
static int alloc_id = 100000; // Used for debugging.
// Initializes a Prefilter, allocating subs_ as necessary.
Prefilter::Prefilter(Op op) {
@@ -24,9 +23,7 @@
if (op_ == AND || op_ == OR)
subs_ = new vector<Prefilter*>;
- GLOBAL_MUTEX_LOCK(alloc_id_mutex);
alloc_id_ = alloc_id++;
- GLOBAL_MUTEX_UNLOCK(alloc_id_mutex);
VLOG(10) << "alloc_id: " << alloc_id_;
}
@@ -34,7 +31,7 @@
Prefilter::~Prefilter() {
VLOG(10) << "Deleted: " << alloc_id_;
if (subs_) {
- for (size_t i = 0; i < subs_->size(); i++)
+ for (int i = 0; i < subs_->size(); i++)
delete (*subs_)[i];
delete subs_;
subs_ = NULL;
@@ -103,7 +100,7 @@
// If a and b match op, merge their contents.
if (a->op() == op && b->op() == op) {
- for (size_t i = 0; i < b->subs()->size(); i++) {
+ for (int i = 0; i < b->subs()->size(); i++) {
Prefilter* bb = (*b->subs())[i];
a->subs()->push_back(bb);
}
@@ -178,7 +175,7 @@
return r;
}
- const CaseFold *f = LookupCaseFold(unicode_tolower, num_unicode_tolower, r);
+ CaseFold *f = LookupCaseFold(unicode_tolower, num_unicode_tolower, r);
if (f == NULL || r < f->lo)
return r;
return ApplyFold(f, r);
@@ -495,7 +492,7 @@
bool latin1() { return latin1_; }
private:
bool latin1_;
- DISALLOW_COPY_AND_ASSIGN(Walker);
+ DISALLOW_EVIL_CONSTRUCTORS(Walker);
};
Prefilter::Info* Prefilter::BuildInfo(Regexp* re) {
@@ -503,7 +500,7 @@
LOG(INFO) << "BuildPrefilter::Info: " << re->ToString();
}
- bool latin1 = (re->parse_flags() & Regexp::Latin1) != 0;
+ bool latin1 = re->parse_flags() & Regexp::Latin1;
Prefilter::Info::Walker w(latin1);
Prefilter::Info* info = w.WalkExponential(re, NULL, 100000);
@@ -672,7 +669,7 @@
return "";
case AND: {
string s = "";
- for (size_t i = 0; i < subs_->size(); i++) {
+ for (int i = 0; i < subs_->size(); i++) {
if (i > 0)
s += " ";
Prefilter* sub = (*subs_)[i];
@@ -682,7 +679,7 @@
}
case OR: {
string s = "(";
- for (size_t i = 0; i < subs_->size(); i++) {
+ for (int i = 0; i < subs_->size(); i++) {
if (i > 0)
s += "|";
Prefilter* sub = (*subs_)[i];
« no previous file with comments | « third_party/re2/re2/prefilter.h ('k') | third_party/re2/re2/prefilter_tree.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698