diff options
| author | hobbs <hobbs> | 2002-05-30 03:26:40 (GMT) |
|---|---|---|
| committer | hobbs <hobbs> | 2002-05-30 03:26:40 (GMT) |
| commit | 97bb85dbe65b8f52991d4e174844a836f755c09f (patch) | |
| tree | 2b353f690614a60acbd9fd9462dbfbe7d0b25932 /generic/tclCmdMZ.c | |
| parent | 053ce50a68a60c39cf83afc5b5388008256400ad (diff) | |
| download | tcl-97bb85dbe65b8f52991d4e174844a836f755c09f.zip tcl-97bb85dbe65b8f52991d4e174844a836f755c09f.tar.gz tcl-97bb85dbe65b8f52991d4e174844a836f755c09f.tar.bz2 | |
* generic/tclExecute.c (TclExecuteByteCode INST_STR_CMP):
* generic/tclCmdMZ.c (Tcl_StringObjCmd): changed the case for
choosing the Tcl_UniCharNcmp compare to when both objs are of
StringType, as benchmarks show that is the optimal check (both
bigendian and littleendian systems).
Diffstat (limited to 'generic/tclCmdMZ.c')
| -rw-r--r-- | generic/tclCmdMZ.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index 3707ca4..c5dfa5d 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -14,7 +14,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclCmdMZ.c,v 1.69 2002/05/29 10:35:45 dkf Exp $ + * RCS: @(#) $Id: tclCmdMZ.c,v 1.70 2002/05/30 03:26:41 hobbs Exp $ */ #include "tclInt.h" @@ -1215,15 +1215,13 @@ Tcl_StringObjCmd(dummy, interp, objc, objv) string1 = (char*) Tcl_GetByteArrayFromObj(objv[0], &length1); string2 = (char*) Tcl_GetByteArrayFromObj(objv[1], &length2); strCmpFn = memcmp; - } else if (((objv[0]->typePtr == &tclStringType) - && (objv[0]->bytes == NULL)) - || ((objv[1]->typePtr == &tclStringType) - && (objv[1]->bytes == NULL))) { + } else if ((objv[0]->typePtr == &tclStringType) + && (objv[1]->typePtr == &tclStringType)) { /* - * Use UNICODE versions of string comparisons since that - * won't cause undue type conversions and we can work with - * characters all of a fixed size (much faster.), but only - * when one of the objects is a pure UNICODE object. + * Do a unicode-specific comparison if both of the args + * are of String type. In benchmark testing this proved + * the most efficient check between the unicode and + * string comparison operations. */ string1 = (char*) Tcl_GetUnicodeFromObj(objv[0], &length1); string2 = (char*) Tcl_GetUnicodeFromObj(objv[1], &length2); |
