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:
qualname = self.name parent = self.get_parent()
for parent in self.walk_parents(): if parent is None:
qualname = parent.name + '.' + qualname qualname = self.name
else:
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: