equal
deleted
inserted
replaced
753 size = len(self._files) |
753 size = len(self._files) |
754 for m in self._dirs.values(): |
754 for m in self._dirs.values(): |
755 size += m.__len__() |
755 size += m.__len__() |
756 return size |
756 return size |
757 |
757 |
|
758 def __nonzero__(self): |
|
759 # Faster than "__len() != 0" since it avoids loading sub-manifests |
|
760 return not self._isempty() |
|
761 |
|
762 __bool__ = __nonzero__ |
|
763 |
758 def _isempty(self): |
764 def _isempty(self): |
759 self._load() # for consistency; already loaded by all callers |
765 self._load() # for consistency; already loaded by all callers |
760 return (not self._files and (not self._dirs or |
766 return (not self._files and (not self._dirs or |
761 all(m._isempty() for m in self._dirs.values()))) |
767 all(m._isempty() for m in self._dirs.values()))) |
762 |
768 |