﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
24221	Use compiled regular expression when checking success_url	Tomáš Ehrlich	Tomáš Ehrlich	"While working on #24220 I also noticed that old-style formatting is checked using `re.search` with inline regexp. Wouldn't it be better to compile regexp pattern in advance at top level? I don't know the real performance gain, but using precompiled regexp where possible is common sense to me.

{{{
if re.search(r'%\([^\)]+\)', self.success_url):
}}}

replace with:

{{{
percent_placeholder = re.compile(r'%\([^\)]+\)')

...

    def get_success_url():
        if percent_placeholder.search(self.success_url):
}}}"	Cleanup/optimization	closed	Generic views	1.8alpha1	Normal	fixed			Unreviewed	1	0	0	0	0	0
