Slightly reduce the insane amounts of indentation in main http server response path, by 'continue'ing around a non-match or falling through

This commit is contained in:
Paul "LeoNerd" Evans 2015-03-05 16:24:13 +00:00
parent dc4b774f1e
commit 9d9d39536b

View File

@ -124,7 +124,9 @@ class JsonResource(HttpServer, resource.Resource):
# and path regex match
for path_entry in self.path_regexs.get(request.method, []):
m = path_entry.pattern.match(request.path)
if m:
if not m:
continue
# We found a match! Trigger callback and then return the
# returned response. We pass both the request and any
# matched groups from the regex to the callback.