D2776: hgweb: use a multidict for holding query string parameters

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Wed Mar 14 00:33:16 EDT 2018


martinvonz added inline comments.

INLINE COMMENTS

> request.py:39-41
> +        # Stores (key, value) 2-tuples. This isn't the most efficient. But we
> +        # don't rely on parameters that much, so it shouldn't be a perf issue.
> +        # we can always add dict for fast lookups.

Sure, that's probably fine, but why? Wouldn't it be easier to write it as dict of lists anyway?

> request.py:45
> +    def __getitem__(self, key):
> +        """Returns the last set value for a key."""
> +        for k, v in reversed(self._items):

Would it make sense to make this an error if there isn't exactly one value?

REPOSITORY
  rHG Mercurial

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

To: indygreg, #hg-reviewers, durin42
Cc: martinvonz, durin42, mercurial-devel


More information about the Mercurial-devel mailing list