summaryrefslogtreecommitdiffstats
path: root/generic/tclExecute.c
diff options
context:
space:
mode:
authorhobbs <hobbs>2002-05-30 03:26:40 (GMT)
committerhobbs <hobbs>2002-05-30 03:26:40 (GMT)
commit06a24b87b9c810cdda2178d9b076750f15348a0b (patch)
tree2b353f690614a60acbd9fd9462dbfbe7d0b25932 /generic/tclExecute.c
parenta8b71532d63c4ab14b2e5c3bca190a3bc87a5cc4 (diff)
downloadtcl-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/tclExecute.c')
-rw-r--r--generic/tclExecute.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 4658711..9d3ec1c 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclExecute.c,v 1.55 2002/05/29 10:35:45 dkf Exp $
+ * RCS: @(#) $Id: tclExecute.c,v 1.56 2002/05/30 03:26:40 hobbs Exp $
*/
#include "tclInt.h"
@@ -2741,12 +2741,12 @@ TclExecuteByteCode(interp, codePtr)
iResult = memcmp(s1, s2,
(size_t) ((s1len < s2len) ? s1len : s2len));
} else if (((valuePtr->typePtr == &tclStringType)
- && (valuePtr->bytes == NULL))
- || ((value2Ptr->typePtr == &tclStringType)
- && (value2Ptr->bytes == NULL))) {
+ && (value2Ptr->typePtr == &tclStringType))) {
/*
- * Do a unicode-specific comparison if one of the args
- * only has the unicode rep.
+ * 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.
*/
Tcl_UniChar *uni1, *uni2;
uni1 = Tcl_GetUnicodeFromObj(valuePtr, &s1len);