asCSSIdentifier: made conversion faster by using a list

This commit is contained in:
Wolfgang Sourdeau committed 2012-11-08 19:15:00 -05:00
1 parent 0ab36d4ec5
commit d797868d71
1 file changed
+6 -6
+6 -6
View File
@@ -207,17 +207,17 @@ def asCSSIdentifier(inputString):
" " : "_SP_", " " : "_SP_",
"'" : "_SQ_", "'" : "_SQ_",
"&" : "_AM_", "&" : "_AM_",
"+" : "_P_" "+" : "_P_"}
}
encodedString = "" newChars = []
for c in inputString: for c in inputString:
if c in cssEscapingCharMap: if c in cssEscapingCharMap:
encodedString += cssEscapingCharMap[c] newChars.append(cssEscapingCharMap[c])
else: else:
encodedString += c newChars.append(c)
return encodedString
return "".join(newChars)
def sqlCleanup(username): def sqlCleanup(username):
OCSFolderInfoURL = getOCSFolderInfoURL() OCSFolderInfoURL = getOCSFolderInfoURL()