Chris McDonough
2011-09-08 0ab0b9ef8a970584e5ef3fdf7d6943e456b95380
python set intersection doesnt special case strings, so using 'in' is a loop is many times faster
1 files modified
6 ■■■■ changed files
pyramid/static.py 6 ●●●● patch | view | raw | blame | history
pyramid/static.py
@@ -168,7 +168,11 @@
        return HTTPMovedPermanently(url)
has_insecure_pathelement = set(['..', '.', '']).intersection
contains_slash = set(['/', os.sep]).intersection
seps = set(['/', os.sep])
def contains_slash(item):
    for sep in seps:
        if sep in item:
            return True
@lru_cache(1000)
def _secure_path(path_tuple):