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

Method Build

extern/re2/re2/prog.cc:409–424  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

407}
408
409void ByteMapBuilder::Build(uint8_t* bytemap, int* bytemap_range) {
410 // Assign byte classes numbered from 0.
411 nextcolor_ = 0;
412
413 int c = 0;
414 while (c < 256) {
415 int next = splits_.FindNextSetBit(c);
416 uint8_t b = static_cast<uint8_t>(Recolor(colors_[next]));
417 while (c <= next) {
418 bytemap[c] = b;
419 c++;
420 }
421 }
422
423 *bytemap_range = nextcolor_;
424}
425
426int ByteMapBuilder::Recolor(int oldcolor) {
427 // Yes, this is a linear search. There can be at most 256

Callers 1

ComputeByteMapMethod · 0.80

Calls 1

FindNextSetBitMethod · 0.80

Tested by

no test coverage detected