D1340: dirstate: add explicit methods for modifying dirstate

mbolin (Michael Bolin) phabricator at mercurial-scm.org
Thu Nov 9 20:01:02 EST 2017


mbolin added inline comments.

INLINE COMMENTS

> dirstate.py:1275
> +        """
> +        exists = f in self._map
> +        if exists:

To avoid doing two lookups in `self._map`:

  try:
      self._map.pop(f)
      return True
  except KeyError:
      return False

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D1340

To: mbthomas, #hg-reviewers
Cc: mbolin, mercurial-devel


More information about the Mercurial-devel mailing list