many iteritems optimizations

This commit is contained in:
mdipierro
2012-08-28 09:35:36 -05:00
parent 18a2c2c68e
commit f9e35599c6
10 changed files with 147 additions and 108 deletions
+3 -2
View File
@@ -1407,7 +1407,7 @@ class Worker(Thread):
raise BadRequest
req = match.groupdict()
for k,v in req.items():
for k,v in req.iteritems():
if not v:
req[k] = ""
if k == 'path':
@@ -1694,7 +1694,8 @@ class FileSystemWorker(Worker):
try:
# Get our file path
headers = dict([(str(k.lower()), v) for k, v in self.read_headers(sock_file).items()])
reader = self.read_headers(sock_file)
headers = dict((k.lower(),v) for k,v in reader.iteritems())
rpath = request.get('path', '').lstrip('/')
filepath = os.path.join(self.root, rpath)
filepath = os.path.abspath(filepath)