summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorKevin B Kenny <kennykb@acm.org>2005-12-02 19:47:36 (GMT)
committerKevin B Kenny <kennykb@acm.org>2005-12-02 19:47:36 (GMT)
commit085b704108e13ba22ac2ce549e259e291740ad68 (patch)
treeeae86bd35d2cef8310355be5ec48797028345bec /library
parent0d8b2ac3539d436923694d412ddc74beb3d2f31f (diff)
downloadtcl-085b704108e13ba22ac2ce549e259e291740ad68.zip
tcl-085b704108e13ba22ac2ce549e259e291740ad68.tar.gz
tcl-085b704108e13ba22ac2ce549e259e291740ad68.tar.bz2
another little speedup to [clock format]
Diffstat (limited to 'library')
-rw-r--r--library/clock.tcl11
1 files changed, 7 insertions, 4 deletions
diff --git a/library/clock.tcl b/library/clock.tcl
index 0c8bdaa..95924ae 100644
--- a/library/clock.tcl
+++ b/library/clock.tcl
@@ -13,7 +13,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: clock.tcl,v 1.26 2005/12/02 16:58:13 kennykb Exp $
+# RCS: @(#) $Id: clock.tcl,v 1.27 2005/12/02 19:47:36 kennykb Exp $
#
#----------------------------------------------------------------------
@@ -652,6 +652,7 @@ proc ::tcl::clock::Initialize {} {
proc ::tcl::clock::format { args } {
+ variable TZData
set format {}
# Check the count of args
@@ -724,9 +725,11 @@ proc ::tcl::clock::format { args } {
if {$timezone eq ""} {
set timezone [GetSystemTimeZone]
}
- if {[catch {SetupTimeZone $timezone} retval opts]} {
- dict unset opts -errorinfo
- return -options $opts $retval
+ if {![info exists TZData($timezone)]} {
+ if {[catch {SetupTimeZone $timezone} retval opts]} {
+ dict unset opts -errorinfo
+ return -options $opts $retval
+ }
}
# Format the result