##// END OF EJS Templates
treemanifest: add an optimized __nonzero__()...
Martin von Zweigbergk -
r36192:b42c47b8 default
parent child Browse files
Show More
@@ -755,6 +755,12 b' class treemanifest(object):'
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
General Comments 0
You need to be logged in to leave comments. Login now