diff options
author | hobbs <hobbs> | 2002-05-30 03:26:40 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2002-05-30 03:26:40 (GMT) |
commit | 06a24b87b9c810cdda2178d9b076750f15348a0b (patch) | |
tree | 2b353f690614a60acbd9fd9462dbfbe7d0b25932 /generic/tclCmdMZ.c | |
parent | a8b71532d63c4ab14b2e5c3bca190a3bc87a5cc4 (diff) | |
download | tcl-06a24b87b9c810cdda2178d9b076750f15348a0b.zip tcl-06a24b87b9c810cdda2178d9b076750f15348a0b.tar.gz tcl-06a24b87b9c810cdda2178d9b076750f15348a0b.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); |