From patchwork Wed Oct 15 19:58:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [3,of,5] filteredset: drop __getitem__ implementation From: Pierre-Yves David X-Patchwork-Id: 6282 Message-Id: To: mercurial-devel@selenic.com Cc: Pierre-Yves David Date: Wed, 15 Oct 2014 12:58:00 -0700 # HG changeset patch # User Pierre-Yves David # Date 1413401912 25200 # Wed Oct 15 12:38:32 2014 -0700 # Node ID fc1641ed19d7a454c10e24711135b4a3d770fe11 # Parent 98ec45f8b54e2935711b64132f179924586ccc33 filteredset: drop __getitem__ implementation It is expensive and not part of the official smartset API. diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -2443,15 +2443,10 @@ class filteredset(abstractsmartset): def __len__(self): # Basic implementation to be changed in future patches. l = baseset([r for r in self]) return len(l) - def __getitem__(self, x): - # Basic implementation to be changed in future patches. - l = baseset([r for r in self]) - return l[x] - def sort(self, reverse=False): self._subset.sort(reverse=reverse) def reverse(self): self._subset.reverse()