Take advantage of parent's cached_qualname when making mine.

This commit is contained in:
voussoir 2018-05-03 18:45:57 -07:00
parent 943deb9bf7
commit 23cc769357

View file

@ -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: