diff options
author | Ben Bangert <ben@groovie.org> | 2008-06-05 17:17:09 -0700 |
---|---|---|
committer | Ben Bangert <ben@groovie.org> | 2008-06-05 17:17:09 -0700 |
commit | 3d7363e00da1fc890c0481b2d45e01cb4c62df54 (patch) | |
tree | f38b62deac2d59cad59199e6271581fbf88185af /routes | |
parent | 789f75fb03f85a8aea7c68ec07d00097493f404d (diff) | |
download | routes-3d7363e00da1fc890c0481b2d45e01cb4c62df54.tar.gz |
Remove unnecessary assignments
--HG--
branch : trunk
Diffstat (limited to 'routes')
-rw-r--r-- | routes/base.py | 8 |
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 |