From: Gaƫtan de Menten Date: Fri, 30 Oct 2009 10:20:19 +0000 (+0000) Subject: minor speed improvement on date, datetime and time types on SQLite X-Git-Tag: rel_0_6beta1~211 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b1a72587509098509c8b4059ab9a27d54b75bcd5;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git minor speed improvement on date, datetime and time types on SQLite --- diff --git a/lib/sqlalchemy/dialects/sqlite/base.py b/lib/sqlalchemy/dialects/sqlite/base.py index 86b2eacd35..31f934bfeb 100644 --- a/lib/sqlalchemy/dialects/sqlite/base.py +++ b/lib/sqlalchemy/dialects/sqlite/base.py @@ -70,9 +70,10 @@ class _DateTimeMixin(object): return process def _result_processor(self, fn, regexp): + rmatch = regexp.match def process(value): if value is not None: - return fn(*[int(x or 0) for x in regexp.match(value).groups()]) + return fn(*[int(x or 0) for x in rmatch(value).groups()]) else: return None return process