diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2012-04-25 12:07:45 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2012-04-25 12:07:45 (GMT) |
commit | 46a826db38fe47acda1efb7714281b9df8ead242 (patch) | |
tree | 9287ec35f60eeed086288278741ae7b69817beda /unix/tclUnixInit.c | |
parent | 5e51fad7d7a9da7e201afd58883e13e04b2aae74 (diff) | |
download | tcl-46a826db38fe47acda1efb7714281b9df8ead242.zip tcl-46a826db38fe47acda1efb7714281b9df8ead242.tar.gz tcl-46a826db38fe47acda1efb7714281b9df8ead242.tar.bz2 |
* generic/tclUtil.c (TclDStringToObj): Added internal function to make
the fairly-common operation of converting a DString into an Obj a more
efficient one.
Diffstat (limited to 'unix/tclUnixInit.c')
-rw-r--r-- | unix/tclUnixInit.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c index 8f872d5..bc1b0e7 100644 --- a/unix/tclUnixInit.c +++ b/unix/tclUnixInit.c @@ -454,8 +454,7 @@ TclpInitLibraryPath( * If TCL_LIBRARY is set, search there. */ - objPtr = Tcl_NewStringObj(str, -1); - Tcl_ListObjAppendElement(NULL, pathPtr, objPtr); + Tcl_ListObjAppendElement(NULL, pathPtr, Tcl_NewStringObj(str, -1)); Tcl_SplitPath(str, &pathc, &pathv); if ((pathc > 0) && (strcasecmp(installLib + 4, pathv[pathc-1]) != 0)) { @@ -469,9 +468,7 @@ TclpInitLibraryPath( pathv[pathc - 1] = installLib + 4; str = Tcl_JoinPath(pathc, pathv, &ds); - objPtr = Tcl_NewStringObj(str, Tcl_DStringLength(&ds)); - Tcl_ListObjAppendElement(NULL, pathPtr, objPtr); - Tcl_DStringFree(&ds); + Tcl_ListObjAppendElement(NULL, pathPtr, TclDStringToObj(&ds)); } ckfree(pathv); } |