Value traverse to Struct parent

This commit is contained in:
Michael Davidsaver
2019-12-23 19:19:09 -08:00
parent a34fe899da
commit 4b5b134e74
5 changed files with 48 additions and 5 deletions
+2 -2
View File
@@ -196,6 +196,7 @@ void build_tree(std::vector<FieldDesc>& desc, const Member& node)
auto& fld = desc[index];
auto& child = desc[cindex];
child.parent_index = cindex-index;
fld.hash ^= std::hash<std::string>{}(cnode.name) ^ child.hash;
@@ -319,8 +320,7 @@ void FieldDesc_calculate_offset(FieldDesc* const top)
{
top->offset = 0;
uint16_t offset = 1;
size_t index = 1;
while(index < top->size()) {
for(size_t index = 1; index < top->size(); ) {
auto& fld = top[index];
switch (fld.code.code) {