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

Method Merge

extern/re2/re2/prog.cc:378–407  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

376}
377
378void ByteMapBuilder::Merge() {
379 for (std::vector<std::pair<int, int>>::const_iterator it = ranges_.begin();
380 it != ranges_.end();
381 ++it) {
382 int lo = it->first-1;
383 int hi = it->second;
384
385 if (0 <= lo && !splits_.Test(lo)) {
386 splits_.Set(lo);
387 int next = splits_.FindNextSetBit(lo+1);
388 colors_[lo] = colors_[next];
389 }
390 if (!splits_.Test(hi)) {
391 splits_.Set(hi);
392 int next = splits_.FindNextSetBit(hi+1);
393 colors_[hi] = colors_[next];
394 }
395
396 int c = lo+1;
397 while (c < 256) {
398 int next = splits_.FindNextSetBit(c);
399 colors_[next] = Recolor(colors_[next]);
400 if (next == hi)
401 break;
402 c = next+1;
403 }
404 }
405 colormap_.clear();
406 ranges_.clear();
407}
408
409void ByteMapBuilder::Build(uint8_t* bytemap, int* bytemap_range) {
410 // Assign byte classes numbered from 0.

Callers 1

ComputeByteMapMethod · 0.80

Calls 6

TestMethod · 0.80
FindNextSetBitMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
SetMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected