# HG changeset patch # User Yuya Nishihara # Date 1487407072 -32400 # Node ID 90fb0193f187f4023f4bd37634bec253f2068892 # Parent 1b065fa21b004f5fefbcd5a22b5eb6cb85d49dd4 smartset: reorder initialization of baseset in more intuitive way What we want to do is to assign either _set or _list per the given data type. diff -r 1b065fa21b00 -r 90fb0193f187 mercurial/smartset.py --- a/mercurial/smartset.py Tue Feb 28 20:23:10 2017 +0100 +++ b/mercurial/smartset.py Sat Feb 18 17:37:52 2017 +0900 @@ -219,16 +219,14 @@ """ self._ascending = None self._istopo = istopo - if not isinstance(data, list): - if isinstance(data, set): - self._set = data - # set has no order we pick one for stability purpose - self._ascending = True - # converting set to list has a cost, do it lazily - data = None - else: + if isinstance(data, set): + # converting set to list has a cost, do it lazily + self._set = data + # set has no order we pick one for stability purpose + self._ascending = True + else: + if not isinstance(data, list): data = list(data) - if data is not None: self._list = data self._datarepr = datarepr