diff options
author | hobbs <hobbs> | 2002-05-29 09:09:57 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2002-05-29 09:09:57 (GMT) |
commit | 3a1941e7d007e93449aa22085687a8fafaddad7e (patch) | |
tree | 9794bcbc0e094b9645add8339f0278666543ef7e /generic/tclIntDecls.h | |
parent | 514dd2a61babad4abc78895bdadec335dd9b4c71 (diff) | |
download | tcl-3a1941e7d007e93449aa22085687a8fafaddad7e.zip tcl-3a1941e7d007e93449aa22085687a8fafaddad7e.tar.gz tcl-3a1941e7d007e93449aa22085687a8fafaddad7e.tar.bz2 |
* generic/tclInt.decls:
* generic/tclIntDecls.h:
* generic/tclStubInit.c:
* generic/tclUtf.c: added TclpUtfNcmp2 private command that
mirrors Tcl_UtfNcmp, but takes n in bytes, not utf-8 chars. This
provides a faster alternative for comparing utf strings internally.
(Tcl_UniCharNcmp, Tcl_UniCharNcasecmp): removed the explicit end
of string check as it wasn't correct for the function (by doc and
logic).
* generic/tclCmdMZ.c (Tcl_StringObjCmd): reworked the string equal
comparison code to use TclpUtfNcmp2 as well as short-circuit for
equal objects or unequal length strings in the equal case.
Removed the use of goto and streamlined the other parts.
* generic/tclExecute.c (TclExecuteByteCode): added check for
object equality in the comparison instructions. Added
short-circuit for != length strings in INST_EQ, INST_NEQ and
INST_STR_CMP. Reworked INST_STR_CMP to use TclpUtfNcmp2 where
appropriate, and only use Tcl_UniCharNcmp when at least one of the
objects is a Unicode obj with no utf bytes.
Diffstat (limited to 'generic/tclIntDecls.h')
-rw-r--r-- | generic/tclIntDecls.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/generic/tclIntDecls.h b/generic/tclIntDecls.h index a16cc73..db179b9 100644 --- a/generic/tclIntDecls.h +++ b/generic/tclIntDecls.h @@ -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: tclIntDecls.h,v 1.40 2002/05/29 00:19:40 hobbs Exp $ + * RCS: @(#) $Id: tclIntDecls.h,v 1.41 2002/05/29 09:09:57 hobbs Exp $ */ #ifndef _TCLINTDECLS @@ -503,6 +503,9 @@ EXTERN void TclSetStartupScriptPath _ANSI_ARGS_(( Tcl_Obj * pathPtr)); /* 168 */ EXTERN Tcl_Obj * TclGetStartupScriptPath _ANSI_ARGS_((void)); +/* 169 */ +EXTERN int TclpUtfNcmp2 _ANSI_ARGS_((CONST char * s1, + CONST char * s2, unsigned long n)); typedef struct TclIntStubs { int magic; @@ -709,6 +712,7 @@ typedef struct TclIntStubs { int (*tclListObjSetElement) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * listPtr, int index, Tcl_Obj * valuePtr)); /* 166 */ void (*tclSetStartupScriptPath) _ANSI_ARGS_((Tcl_Obj * pathPtr)); /* 167 */ Tcl_Obj * (*tclGetStartupScriptPath) _ANSI_ARGS_((void)); /* 168 */ + int (*tclpUtfNcmp2) _ANSI_ARGS_((CONST char * s1, CONST char * s2, unsigned long n)); /* 169 */ } TclIntStubs; #ifdef __cplusplus @@ -1325,6 +1329,10 @@ extern TclIntStubs *tclIntStubsPtr; #define TclGetStartupScriptPath \ (tclIntStubsPtr->tclGetStartupScriptPath) /* 168 */ #endif +#ifndef TclpUtfNcmp2 +#define TclpUtfNcmp2 \ + (tclIntStubsPtr->tclpUtfNcmp2) /* 169 */ +#endif #endif /* defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS) */ |