summaryrefslogtreecommitdiff
path: root/routes
diff options
context:
space:
mode:
authorBen Bangert <ben@groovie.org>2008-06-05 17:17:09 -0700
committerBen Bangert <ben@groovie.org>2008-06-05 17:17:09 -0700
commit3d7363e00da1fc890c0481b2d45e01cb4c62df54 (patch)
treef38b62deac2d59cad59199e6271581fbf88185af /routes
parent789f75fb03f85a8aea7c68ec07d00097493f404d (diff)
downloadroutes-3d7363e00da1fc890c0481b2d45e01cb4c62df54.tar.gz
Remove unnecessary assignments
--HG-- branch : trunk
Diffstat (limited to 'routes')
-rw-r--r--routes/base.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/routes/base.py b/routes/base.py
index b75d73c..0002841 100644
--- a/routes/base.py
+++ b/routes/base.py
@@ -523,17 +523,13 @@ class Route(object):
if isinstance(part, dict):
arg = part['name']
- # For efficiency, check these just once
- has_arg = arg in kargs
- has_default = arg in self.defaults
-
# Ensure that our dict is updated if its not None and
- if has_arg and kargs[arg] is not None:
+ if arg in kargs and kargs[arg] is not None:
all_args[arg] = kargs[arg]
# Otherwise, we weren't passed the arg, but we can't use
# None when making the URL, so remove it from the dict
- elif has_default and all_args[arg] is None:
+ elif arg in self.defaults and all_args[arg] is None:
del all_args[arg]
if bool(self.minkeys - frozenset(all_args.keys())):
return False