# HG changeset patch # User Martin von Zweigbergk # Date 1448990793 28800 # Node ID f8f716da90faf630bc89fc90cd86a059dc8db5e8 # Parent b4d517d736a18f0b6d6d06cd82065bdd5d1bc2b0 mergestate: implement unresolvedcount() in terms of unresolved() This simplifies the method slightly. It does create a full list of paths while doing so, but it's not a lot of data anyway (besides, I would think references to strings are no larger than (references to?) True). diff -r b4d517d736a1 -r f8f716da90fa mercurial/merge.py --- a/mercurial/merge.py Tue Dec 01 09:26:10 2015 -0800 +++ b/mercurial/merge.py Tue Dec 01 09:26:33 2015 -0800 @@ -567,8 +567,7 @@ def unresolvedcount(self): """get unresolved count for this merge (persistent)""" - return len([True for f, entry in self._state.iteritems() - if entry[0] == 'u']) + return len(list(self.unresolved())) def actions(self): """return lists of actions to perform on the dirstate"""