diff babel/dates.py @ 502:0985a4562967

Small speed improvement for format_date() by getting rid of duplicate parse_pattern. Issue: #216 Submitted by: St?phane D?murget
author jruigrok
date Tue, 22 Feb 2011 15:16:13 +0000
parents 3f3c1696ad39
children 3413235af4d8
line wrap: on
line diff
--- a/babel/dates.py
+++ b/babel/dates.py
@@ -457,7 +457,7 @@
     if format in ('full', 'long', 'medium', 'short'):
         format = get_date_format(format, locale=locale)
     pattern = parse_pattern(format)
-    return parse_pattern(format).apply(date, locale)
+    return pattern.apply(date, locale)
 
 def format_datetime(datetime=None, format='medium', tzinfo=None,
                     locale=LC_TIME):
Copyright (C) 2012-2017 Edgewall Software