| 50 | { } |
| 51 | |
| 52 | alloc_slice writeTree() { |
| 53 | auto n = _strings.size(); |
| 54 | size_t totalSize = 1 + sizeKeyTree(0, n); |
| 55 | alloc_slice output(totalSize); |
| 56 | _out = (uint8_t*)output.buf; |
| 57 | |
| 58 | writeByte((uint8_t)ceil(log2(n))); // Write the depth first |
| 59 | writeKeyTree(0, n); |
| 60 | assert_postcondition(_out == output.end()); |
| 61 | return output; |
| 62 | } |
| 63 | |
| 64 | private: |
| 65 | const std::vector<slice> &_strings; |
no test coverage detected