Skip to content

Commit

Permalink
Revert "refactor to make a bit less efficient, but (subjectivly) more…
Browse files Browse the repository at this point in the history
… understandable"

This reverts commit 25337db.
  • Loading branch information
aljazerzen committed Feb 21, 2024
1 parent 25337db commit fa1cbd1
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions edb/schema/constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,14 +200,17 @@ def get_constraint_origins(
their generation.
"""

# abstract constraints don't have an origin
# delegated constraints don't have an origin
if self.is_non_concrete(schema) or self.get_delegated(schema):
return []

# collect origins from all ancestors
origins: Set[Constraint] = set()
for base in self.get_bases(schema).objects(schema):
# abstract bases are not an origin
if base.is_non_concrete(schema):
continue
# delegated bases are not an origin
if base.get_delegated(schema):
continue

# recurse
origins.update(base.get_constraint_origins(schema))

# if no ancestors have an origin, I am the origin
Expand Down

0 comments on commit fa1cbd1

Please sign in to comment.