drop unused FieldDesc::hash

This commit is contained in:
Michael Davidsaver
2020-03-09 14:48:39 -07:00
parent bcdf743ae9
commit d10eefac0e
3 changed files with 0 additions and 14 deletions
-6
View File
@@ -133,7 +133,6 @@ void from_wire(Buffer& buf, std::vector<FieldDesc>& descs, TypeStore& cache, uns
auto& fld = descs.back();
fld.code = code;
fld.hash = code.code;
}
switch(code.code) {
@@ -157,7 +156,6 @@ void from_wire(Buffer& buf, std::vector<FieldDesc>& descs, TypeStore& cache, uns
auto& fld = descs.back();
fld.miter.reserve(nfld.size);
fld.hash ^= std::hash<std::string>{}(fld.id);
}
auto& cdescs = code.code==TypeCode::Struct ? descs : descs.back().members;
@@ -180,10 +178,6 @@ void from_wire(Buffer& buf, std::vector<FieldDesc>& descs, TypeStore& cache, uns
if(code.code==TypeCode::Struct)
cfld.parent_index = cindex-cref;
// update hash
// TODO investigate better ways to combine hashes
fld.hash ^= std::hash<std::string>{}(name) ^ cfld.hash;
// update field refs.
fld.miter.emplace_back(name, cindex-cref);
fld.mlookup[name] = cindex-cref;
-4
View File
@@ -65,10 +65,6 @@ struct FieldDesc {
// child iteration. child# -> ("sub", rel index in enclosing vector<FieldDesc>)
std::vector<std::pair<std::string, size_t>> miter;
// hash of this type (aggragating from children)
// created using the code ^ id ^ (child_name ^ child_hash)*N
size_t hash;
// number of FieldDesc nodes between this node and it's a parent Struct (or 0 if no parent).
// This value also appears in the parent's miter and mlookup mappings.
// Only usable when a StructTop is accessible and this!=StructTop::desc
-4
View File
@@ -148,7 +148,6 @@ void build_tree(std::vector<FieldDesc>& desc, const Member& node)
auto& fld = desc.back();
fld.code = node.code;
// struct/union array have no ID
fld.hash = node.code.code;
Member next{code.scalarOf(), node.name};
next.id = node.id;
@@ -165,7 +164,6 @@ void build_tree(std::vector<FieldDesc>& desc, const Member& node)
auto& fld = desc.back();
fld.code = code;
fld.id = node.id;
fld.hash = code.code ^ std::hash<std::string>{}(fld.id);
}
auto& cdescs = code.code==TypeCode::Struct ? desc : desc.back().members;
@@ -181,8 +179,6 @@ void build_tree(std::vector<FieldDesc>& desc, const Member& node)
if(code.code==TypeCode::Struct)
child.parent_index = cindex-cref;
fld.hash ^= std::hash<std::string>{}(cnode.name) ^ child.hash;
fld.mlookup[cnode.name] = cindex-cref;
fld.miter.emplace_back(cnode.name, cindex-cref);