MCPcopy Create free account
hub / github.com/couchbase/fleece / writeTree

Method writeTree

Experimental/KeyTree.cc:52–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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;

Callers 1

fromSortedStringsMethod · 0.80

Calls 2

sizeMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected