summaryrefslogtreecommitdiffstats
path: root/generic/tclZlib.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2012-04-25 12:07:45 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2012-04-25 12:07:45 (GMT)
commit48b4ced1fb2381c99f9bb47352a5115e4d8971ed (patch)
tree9287ec35f60eeed086288278741ae7b69817beda /generic/tclZlib.c
parente0311d16a8f5d0e2a740f60e623439d13b052b76 (diff)
downloadtcl-48b4ced1fb2381c99f9bb47352a5115e4d8971ed.zip
tcl-48b4ced1fb2381c99f9bb47352a5115e4d8971ed.tar.gz
tcl-48b4ced1fb2381c99f9bb47352a5115e4d8971ed.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 'generic/tclZlib.c')
-rw-r--r--generic/tclZlib.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/generic/tclZlib.c b/generic/tclZlib.c
index 341f8e0..3673833 100644
--- a/generic/tclZlib.c
+++ b/generic/tclZlib.c
@@ -399,9 +399,7 @@ ExtractHeader(
Tcl_ExternalToUtfDString(latin1enc, (char *) headerPtr->comment, -1,
&tmp);
- SetValue(dictObj, "comment", Tcl_NewStringObj(Tcl_DStringValue(&tmp),
- Tcl_DStringLength(&tmp)));
- Tcl_DStringFree(&tmp);
+ SetValue(dictObj, "comment", TclDStringToObj(&tmp));
}
SetValue(dictObj, "crc", Tcl_NewBooleanObj(headerPtr->hcrc));
if (headerPtr->name != Z_NULL) {
@@ -418,9 +416,7 @@ ExtractHeader(
Tcl_ExternalToUtfDString(latin1enc, (char *) headerPtr->name, -1,
&tmp);
- SetValue(dictObj, "filename", Tcl_NewStringObj(Tcl_DStringValue(&tmp),
- Tcl_DStringLength(&tmp)));
- Tcl_DStringFree(&tmp);
+ SetValue(dictObj, "filename", TclDStringToObj(&tmp));
}
if (headerPtr->os != 255) {
SetValue(dictObj, "os", Tcl_NewIntObj(headerPtr->os));