changeset 9681:ac3a68cb16eb

patch: simplify logic
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Sat, 31 Oct 2009 18:00:05 +0100
parents 8cea86d73887
children bd70f645cfb0
files mercurial/patch.py
diffstat 1 files changed, 1 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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))