| 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];
|
|
|