Cache result of Language::isValidCode() to avoid regex processing
authorlwelling <lwelling@wikimedia.org>
Fri, 3 May 2013 00:34:25 +0000 (20:34 -0400)
committerlwelling <lwelling@wikimedia.org>
Fri, 3 May 2013 00:41:18 +0000 (20:41 -0400)
commit04a9d80e53f64ae97d75e746377f83f8519e416d
treea038bf27a08c55d6d2919e29e25d8ab51ea367a9
parent839c2aaf805866aed5b8b6dda9c060090ea75a29
Cache result of Language::isValidCode() to avoid regex processing

The function can be called over 2000 times in generating a page. This way
is significantly faster even for random invalid codes.  For real use it
should avoid the regex most of the time with no change in behavior.

Change-Id: I9fcbae1770be0d3f405d3d12254c11943b0d5f46
languages/Language.php