| 69 | } |
| 70 | |
| 71 | StringPiece BlockBuilder::Finish() { |
| 72 | // Append restart array |
| 73 | CHECK_LE(restarts_.size(), std::numeric_limits<uint32_t>::max()); |
| 74 | for (const auto r : restarts_) { |
| 75 | core::PutFixed32(&buffer_, r); |
| 76 | } |
| 77 | // Downcast safe because of the CHECK. |
| 78 | core::PutFixed32(&buffer_, static_cast<uint32_t>(restarts_.size())); |
| 79 | finished_ = true; |
| 80 | return StringPiece(buffer_); |
| 81 | } |
| 82 | |
| 83 | void BlockBuilder::Add(const StringPiece& key, const StringPiece& value) { |
| 84 | StringPiece last_key_piece(last_key_); |
nothing calls this directly
no test coverage detected