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

Unified Diff: third_party/re2/re2/prog.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/prog.h ('k') | third_party/re2/re2/re2.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/re2/re2/prog.cc
diff --git a/third_party/re2/re2/prog.cc b/third_party/re2/re2/prog.cc
index 499f560f8d64fc01752a3501f1f0bd9f14c3b803..ef9ef2386cd2edc5da510c9bb528eb7a70d064bc 100644
--- a/third_party/re2/re2/prog.cc
+++ b/third_party/re2/re2/prog.cc
@@ -25,7 +25,7 @@
set_out_opcode(out, kInstByteRange);
lo_ = lo & 0xFF;
hi_ = hi & 0xFF;
- foldcase_ = foldcase & 0xFF;
+ foldcase_ = foldcase;
}
void Prog::Inst::InitCapture(int cap, uint32 out) {
@@ -295,15 +295,13 @@
}
void Prog::MarkByteRange(int lo, int hi) {
- DCHECK_GE(lo, 0);
- DCHECK_GE(hi, 0);
- DCHECK_LE(lo, 255);
- DCHECK_LE(hi, 255);
- DCHECK_LE(lo, hi);
- if (0 < lo && lo <= 255)
+ CHECK_GE(lo, 0);
+ CHECK_GE(hi, 0);
+ CHECK_LE(lo, 255);
+ CHECK_LE(hi, 255);
+ if (lo > 0)
byterange_.Set(lo - 1);
- if (0 <= hi && hi <= 255)
- byterange_.Set(hi);
+ byterange_.Set(hi);
}
void Prog::ComputeByteMap() {
@@ -327,12 +325,12 @@
bytemap_range_ = bytemap_[255] + 1;
unbytemap_ = new uint8[bytemap_range_];
for (int i = 0; i < 256; i++)
- unbytemap_[bytemap_[i]] = static_cast<uint8>(i);
+ unbytemap_[bytemap_[i]] = i;
if (0) { // For debugging: use trivial byte map.
for (int i = 0; i < 256; i++) {
- bytemap_[i] = static_cast<uint8>(i);
- unbytemap_[i] = static_cast<uint8>(i);
+ bytemap_[i] = i;
+ unbytemap_[i] = i;
}
bytemap_range_ = 256;
LOG(INFO) << "Using trivial bytemap.";
« no previous file with comments | « third_party/re2/re2/prog.h ('k') | third_party/re2/re2/re2.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698