openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #08431
Re: [Merge] lp:~googol-hush/openlp/render into lp:openlp
Review: Needs Fixing
Firstly, re.compile(r'<br>.*$').sub(u'', html_text) is identical to re.sub(r'<br>.*$', u'', html_text)
Secondly, re.compile is used to compile a regex once and use it in multiple places, because regexs are slow. So do that instead of compiling the same regex multiple times.
Lastly, regexes are *much* slower than string operations, you might want to use "newstr = oldstr[oldstr.rfind(u'<br>'):]" instead
--
https://code.launchpad.net/~googol-hush/openlp/render/+merge/59467
Your team OpenLP Core is subscribed to branch lp:openlp.
References