hidden: remove unnecessary guard condition
authorMartin von Zweigbergk <martinvonz@google.com>
Tue, 30 May 2017 13:16:32 -0700
changeset 32593 e4d0b2efb8b5
parent 32592 c37ca35b8450
child 32594 517841766994
hidden: remove unnecessary guard condition The "if visible" guard is now pretty pointless, because the function call it guards will do almost no work anyway when there are no visible revisions. We can also stop wrapping "visible" in a set since it just needs to be an iterable now.
mercurial/repoview.py
--- a/mercurial/repoview.py	Tue May 30 10:27:20 2017 -0700
+++ b/mercurial/repoview.py	Tue May 30 13:16:32 2017 -0700
@@ -76,9 +76,8 @@
         mutablephases = (phases.draft, phases.secret)
         mutable = repo._phasecache.getrevset(repo, mutablephases)
 
-        visible = set(mutable - hidden)
-        if visible:
-            _revealancestors(pfunc, hidden, visible)
+        visible = mutable - hidden
+        _revealancestors(pfunc, hidden, visible)
     return frozenset(hidden)
 
 def computeunserved(repo):