Skip to content

Commit 81b3c62

Browse files
authored
Merge pull request #331 from sneakers-the-rat/perf-bool
[perf] swap out bool with `is None` in `induced_slot`
2 parents 09b1f0c + d3b5417 commit 81b3c62

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

linkml_runtime/utils/schemaview.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,7 +1317,7 @@ def induced_slot(self, slot_name: SLOT_NAME, class_name: CLASS_NAME = None, impo
13171317
# attributes take priority over schema-level slot definitions, IF
13181318
# the attributes is declared for the class or an ancestor
13191319
slot_comes_from_attribute = False
1320-
if cls:
1320+
if cls is not None:
13211321
slot = self.get_slot(slot_name, imports, attributes=False)
13221322
# traverse ancestors (reflexive), starting with
13231323
# the main class
@@ -1353,7 +1353,7 @@ def induced_slot(self, slot_name: SLOT_NAME, class_name: CLASS_NAME = None, impo
13531353
# inheritance of slots; priority order
13541354
# slot-level assignment < ancestor slot_usage < self slot_usage
13551355
v = getattr(induced_slot, metaslot_name, None)
1356-
if not cls:
1356+
if cls is None:
13571357
propagated_from = []
13581358
else:
13591359
propagated_from = self.class_ancestors(class_name, reflexive=True, mixins=True)

0 commit comments

Comments
 (0)