small speedup for large Multisite pages
Message-ID: <54745ede.wW1gBWvn0xMnqWQc%mk(a)mathias-kettner.de>
User-Agent: Heirloom mailx 12.5 6/20/10
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Module: check_mk
Branch: master
Commit: be7a859377ccad63b8740ebbf1b2e1033f87b302
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=be7a859377ccad…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Nov 25 11:50:03 2014 +0100
Faster implementation of attrencode, small speedup for large Multisite pages
---
web/htdocs/htmllib.py | 14 +-------------
1 file changed, 1 insertion(+), 13 deletions(-)
diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py
index c43be21..1727e0f 100644
--- a/web/htdocs/htmllib.py
+++ b/web/htdocs/htmllib.py
@@ -1213,19 +1213,7 @@ class html:
elif type(value) not in [str, unicode]:
value = str(value)
- new = ""
- for c in value:
- if c == '"':
- new += """
- elif c == '<':
- new += "<"
- elif c == '>':
- new += ">"
- else:
- new += c
- return new
-
-
+ return value.replace('"',
""").replace("<",
"<").replace(">", ">")
# This function returns a str object, never unicode!
# Beware: this code is crucial for the performance of Multisite!