diff options
author | kennykb <kennykb@noemail.net> | 2005-12-02 22:13:40 (GMT) |
---|---|---|
committer | kennykb <kennykb@noemail.net> | 2005-12-02 22:13:40 (GMT) |
commit | daad2214ad8b2353e4d6c2d7d667cebb8325a6b8 (patch) | |
tree | 3cbcc441bcbfe452d218076d812b767e4fa3b16c | |
parent | c4bd95ca5f8075890feaafea7661c6f6d1409c3d (diff) | |
download | tcl-daad2214ad8b2353e4d6c2d7d667cebb8325a6b8.zip tcl-daad2214ad8b2353e4d6c2d7d667cebb8325a6b8.tar.gz tcl-daad2214ad8b2353e4d6c2d7d667cebb8325a6b8.tar.bz2 |
another puny speedup - no error thrown from ::tcl::clock::getenv
FossilOrigin-Name: ba6ea252870935b03bacff5185cba297bf457d4b
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | generic/tclClock.c | 11 | ||||
-rw-r--r-- | library/clock.tcl | 6 |
3 files changed, 13 insertions, 15 deletions
@@ -1,10 +1,11 @@ 2005-12-02 Kevin B. Kenny <kennykb@acm.org> - * library/clock.tcl: Moved a tiny bit more of [clock format] from - run time to compile time, and fixed a l10n bug in the process. - [Bug 1371446]. Also, conditoned the call to SetupTimeZone to speed - the common case where TZData($timezone) already exists. - + * generic/tclClock.c: Moved a tiny bit more of [clock format] from + * library/clock.tcl: run time to compile time, and fixed a l10n + bug in the process. [Bug 1371446]. Also, conditoned the call to + SetupTimeZone to speed the common case where TZData($timezone) + already exists, and achieved a puny speedup by making + ::tcl::clock::getenv not throw errors. * unix/Makefile.in: Made some changes to support a 'make' command that is present on some antiquated versions of Solaris. diff --git a/generic/tclClock.c b/generic/tclClock.c index 522f6b1..69abb95 100644 --- a/generic/tclClock.c +++ b/generic/tclClock.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclClock.c,v 1.48 2005/12/01 06:11:40 das Exp $ + * RCS: @(#) $Id: tclClock.c,v 1.49 2005/12/02 22:13:41 kennykb Exp $ */ #include "tclInt.h" @@ -1481,13 +1481,10 @@ ClockGetenvObjCmd( varName = Tcl_GetStringFromObj(objv[1], NULL); varValue = getenv(varName); if (varValue == NULL) { - Tcl_SetObjResult(interp, - Tcl_NewStringObj("variable not found", -1)); - return TCL_ERROR; - } else { - Tcl_SetObjResult(interp, Tcl_NewStringObj(varValue, -1)); - return TCL_OK; + varValue = ""; } + Tcl_SetObjResult(interp, Tcl_NewStringObj(varValue, -1)); + return TCL_OK; } /* diff --git a/library/clock.tcl b/library/clock.tcl index 95924ae..4c64c27 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.27 2005/12/02 19:47:36 kennykb Exp $ +# RCS: @(#) $Id: clock.tcl,v 1.28 2005/12/02 22:13:41 kennykb Exp $ # #---------------------------------------------------------------------- @@ -3087,9 +3087,9 @@ proc ::tcl::clock::GetSystemTimeZone {} { variable CachedSystemTimeZone variable TimeZoneBad - if { ![catch {getenv TCL_TZ} result] } { + if {[set result [getenv TCL_TZ]] ne {}} { set timezone $result - } elseif { ![catch {getenv TZ} result] } { + } elseif {[set result [getenv TZ]] ne {}} { set timezone $result } elseif { [info exists CachedSystemTimeZone] } { set timezone $CachedSystemTimeZone |