allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hei...@apache.org
Subject [49/50] [abbrv] allura git commit: [#7925] use frozensets for faster O(1) checking of file extensions
Date Mon, 10 Aug 2015 17:33:20 GMT
[#7925] use frozensets for faster O(1) checking of file extensions


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/d8e7ade5
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/d8e7ade5
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/d8e7ade5

Branch: refs/heads/hs/7925
Commit: d8e7ade5d7ec8fa35d09b4d2cb2a4ee2aa54bb29
Parents: 46baba1
Author: Dave Brondsema <dbrondsema@slashdotmedia.com>
Authored: Fri Aug 7 18:04:45 2015 +0000
Committer: Heith Seewald <hseewald@slashdotmedia.com>
Committed: Mon Aug 10 09:38:38 2015 -0400

----------------------------------------------------------------------
 Allura/allura/model/repository.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/d8e7ade5/Allura/allura/model/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repository.py b/Allura/allura/model/repository.py
index acbc3d1..77c3fc4 100644
--- a/Allura/allura/model/repository.py
+++ b/Allura/allura/model/repository.py
@@ -65,10 +65,10 @@ config = utils.ConfigProxy(
     common_prefix='forgemail.url')
 
 README_RE = re.compile('^README(\.[^.]*)?$', re.IGNORECASE)
-VIEWABLE_EXTENSIONS = [
+VIEWABLE_EXTENSIONS = frozenset([
     '.php', '.py', '.js', '.java', '.html', '.htm', '.yaml', '.sh',
     '.rb', '.phtml', '.txt', '.bat', '.ps1', '.xhtml', '.css', '.cfm', '.jsp', '.jspx',
-    '.pl', '.php4', '.php3', '.rhtml', '.svg', '.markdown', '.json', '.ini', '.tcl', '.vbs',
'.xsl']
+    '.pl', '.php4', '.php3', '.rhtml', '.svg', '.markdown', '.json', '.ini', '.tcl', '.vbs',
'.xsl'])
 
 
 # Some schema types
@@ -77,7 +77,7 @@ SObjType = S.OneOf('blob', 'tree', 'submodule')
 
 # Used for when we're going to batch queries using $in
 QSIZE = 100
-BINARY_EXTENSIONS = [
+BINARY_EXTENSIONS = frozenset([
     ".3ds", ".3g2", ".3gp", ".7z", ".a", ".aac", ".adp", ".ai", ".aif", ".apk", ".ar", ".asf",
".au", ".avi",
     ".bak", ".bin", ".bk", ".bmp", ".btif", ".bz2", ".cab", ".caf", ".cgm", ".cmx", ".cpio",
".cr2", ".dat", ".deb", ".djvu", ".dll",
     ".dmg", ".dng", ".doc", ".docx", ".dra", ".DS_Store", ".dsk", ".dts", ".dtshd", ".dvb",
".dwg", ".dxf", ".ecelp4800",
@@ -90,9 +90,9 @@ BINARY_EXTENSIONS = [
     ".smv", ".so", ".sub", ".swf", ".tar", ".tbz2", ".tga", ".tgz", ".tif", ".tiff", ".tlz",
".ts", ".ttf", ".uvh", ".uvi", ".uvm",
     ".uvp", ".uvs", ".uvu", ".viv", ".vob", ".war", ".wav", ".wax", ".wbmp", ".wdp", ".weba",
".webm", ".webp", ".whl", ".wm", ".wma",
     ".wmv", ".wmx", ".woff", ".woff2", ".wvx", ".xbm", ".xif", ".xm", ".xpi", ".xpm", ".xwd",
".xz", ".z", ".zip", ".zipx"
-]
+])
 
-PYPELINE_EXTENSIONS = utils.MARKDOWN_EXTENSIONS + ['.rst']
+PYPELINE_EXTENSIONS = frozenset(utils.MARKDOWN_EXTENSIONS + ['.rst'])
 
 DIFF_SIMILARITY_THRESHOLD = .5  # used for determining file renames
 


Mime
View raw message