Take advantage of parent's cached_qualname when making mine.
This commit is contained in:
parent
943deb9bf7
commit
23cc769357
1 changed files with 5 additions and 3 deletions
|
@ -1393,9 +1393,11 @@ class Tag(ObjectBase, GroupableMixin):
|
||||||
if self._cached_qualified_name:
|
if self._cached_qualified_name:
|
||||||
qualname = self._cached_qualified_name
|
qualname = self._cached_qualified_name
|
||||||
else:
|
else:
|
||||||
|
parent = self.get_parent()
|
||||||
|
if parent is None:
|
||||||
qualname = self.name
|
qualname = self.name
|
||||||
for parent in self.walk_parents():
|
else:
|
||||||
qualname = parent.name + '.' + qualname
|
qualname = parent.qualified_name() + '.' + self.name
|
||||||
self._cached_qualified_name = qualname
|
self._cached_qualified_name = qualname
|
||||||
|
|
||||||
if max_len is None or len(qualname) <= max_len:
|
if max_len is None or len(qualname) <= max_len:
|
||||||
|
|
Loading…
Reference in a new issue