# HG changeset patch # User Benoit Boissinot # Date 1257008405 -3600 # Node ID ac3a68cb16ebc6ef7b09bf070793d164e823d565 # Parent 8cea86d73887c0d78b74f0a39087bc8df28d16d3 patch: simplify logic diff -r 8cea86d73887 -r ac3a68cb16eb mercurial/patch.py --- a/mercurial/patch.py Sat Oct 31 17:07:12 2009 +0100 +++ b/mercurial/patch.py Sat Oct 31 18:00:05 2009 +0100 @@ -342,11 +342,7 @@ # result is a list of line numbers sorted based on distance # from linenum - try: - cand = self.hash[l] - except: - return [] - + cand = self.hash.get(l, []) if len(cand) > 1: # resort our list of potentials forward then back. cand.sort(key=lambda x: abs(x - linenum))