summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin B Kenny <kennykb@acm.org>2005-04-13 19:28:44 (GMT)
committerKevin B Kenny <kennykb@acm.org>2005-04-13 19:28:44 (GMT)
commit542e26909ff74475784c87d36451da9fba244974 (patch)
tree78a9dd782e7183786326950da5732b225b195b16
parent88876140f24ed52414615719e0e817624d9e98d9 (diff)
downloadtcl-542e26909ff74475784c87d36451da9fba244974.zip
tcl-542e26909ff74475784c87d36451da9fba244974.tar.gz
tcl-542e26909ff74475784c87d36451da9fba244974.tar.bz2
Performance improvement in [clock] - FR 1182459
-rw-r--r--ChangeLog6
-rw-r--r--library/clock.tcl8
2 files changed, 10 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index c592c22..e17b025 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-04-13 Kevin B. Kenny <kennykb@acm.org>
+
+ * library/clock.n: Added a missing '--' on several [switch]
+ commands to improve performance of [clock format] and related
+ operations. [Feature Request 1182459]
+
2005-04-13 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
* doc/fcopy.n: Improved documentation on copying binary files,
diff --git a/library/clock.tcl b/library/clock.tcl
index d47429c..337ed5a 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.13 2004/12/29 20:57:28 kennykb Exp $
+# RCS: @(#) $Id: clock.tcl,v 1.14 2005/04/13 19:28:51 kennykb Exp $
#
#----------------------------------------------------------------------
@@ -707,7 +707,7 @@ proc ::tcl::clock::format { args } {
set state {}
set retval {}
foreach char [split $format {}] {
- switch -exact $state {
+ switch -exact -- $state {
{} {
if { [string equal % $char] } {
set state percent
@@ -4411,7 +4411,7 @@ proc ::tcl::clock::GetJulianDayFromEraYearMonthDay { date } {
# Get absolute year number from the civil year
- switch -exact [dict get $date era] {
+ switch -exact -- [dict get $date era] {
BCE {
set year [expr { 1 - [dict get $date year] }]
}
@@ -4493,7 +4493,7 @@ proc ::tcl::clock::GetJulianDayFromEraYearDay { date } {
# Get absolute year number from the civil year
- switch -exact [dict get $date era] {
+ switch -exact -- [dict get $date era] {
BCE {
set year [expr { 1 - [dict get $date year] }]
}