Skip to content

Commit

Permalink
odb: simplify code for destructibe fields
Browse files Browse the repository at this point in the history
Signed-off-by: Felipe Garay <fgaray@google.com>
  • Loading branch information
fgaray committed Nov 21, 2023
1 parent fbb3099 commit 5199285
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/odb/src/codeGenerator/gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,8 @@ def get_json_files(directory):
else:
field["setterArgumentType"] = field["getterReturnType"] = field["type"]

if field["name"] == '_name' and 'no-destruct' not in field["flags"]:
klass["has_destructible_fields"] = True

if "table" in field:
# For fields that we need to free/destroy in the destructor
if field["name"] == '_name' and 'no-destruct' not in field["flags"] or "table" in field:
klass["has_destructible_fields"] = True

klass["fields"] = [field for field in klass["fields"] if "bits" not in field]
Expand Down

0 comments on commit 5199285

Please sign in to comment.