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.

_______________________________________________
Mailing list: https://launchpad.net/~openlp-core
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp

Reply via email to