diff options
author | dgp <dgp@noemail.net> | 2005-05-05 18:37:42 (GMT) |
---|---|---|
committer | dgp <dgp@noemail.net> | 2005-05-05 18:37:42 (GMT) |
commit | 5bc71970a22dc3780f9defb6c6e7c61fdabd14a9 (patch) | |
tree | 528333d487c2d5ed865f278d50536ea98959741c /generic/tclCompCmds.c | |
parent | 55eef83aad6ef7520301b8f1fc7e4095fea032fe (diff) | |
download | tcl-5bc71970a22dc3780f9defb6c6e7c61fdabd14a9.zip tcl-5bc71970a22dc3780f9defb6c6e7c61fdabd14a9.tar.gz tcl-5bc71970a22dc3780f9defb6c6e7c61fdabd14a9.tar.bz2 |
* generic/tclInt.decls: Converted TclMatchIsTrivial to a macro.
* generic/tclInt.h:
* generic/tclUtil.c:
* generic/tclIntDecls.h: `make genstubs`
* generic/tclStubInit.c:
* generic/tclBasic.c: Added callers of TclMatchIsTrivial where
* generic/tclCmdIL.c: a search can be done more efficiently
* generic/tclCompCmds.c:when it is recognized that a pattern match
* generic/tclDictObj.c: is really an exact match. [Patch 1076088]
* generic/tclIO.c:
* generic/tclNamesp.c:
* generic/tclVar.c:
FossilOrigin-Name: 751ccc1989f52d5d0cb315ae9aaa566bf255cf66
Diffstat (limited to 'generic/tclCompCmds.c')
-rw-r--r-- | generic/tclCompCmds.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c index 97e1ff4..bd0c4b7 100644 --- a/generic/tclCompCmds.c +++ b/generic/tclCompCmds.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: tclCompCmds.c,v 1.66 2005/05/05 17:21:03 dgp Exp $ + * RCS: @(#) $Id: tclCompCmds.c,v 1.67 2005/05/05 18:37:57 dgp Exp $ */ #include "tclInt.h" @@ -2612,18 +2612,13 @@ TclCompileStringCmd(interp, parsePtr, envPtr) length = varTokenPtr[1].size; if (!nocase && (i == 0)) { /* - * On the first (pattern) arg, check to see if any - * glob special characters are in the word '*[]?\\'. - * If not, this is the same as 'string equal'. We - * can use strpbrk here because the glob chars are all - * in the ascii-7 range. If -nocase was specified, - * we can't do this because INST_STR_EQ has no support - * for nocase. + * Trivial matches can be done by 'string equal'. + * If -nocase was specified, we can't do this + * because INST_STR_EQ has no support for nocase. */ Tcl_Obj *copy = Tcl_NewStringObj(str, length); Tcl_IncrRefCount(copy); - exactMatch = (strpbrk(Tcl_GetString(copy), - "*[]?\\") == NULL); + exactMatch = TclMatchIsTrivial(Tcl_GetString(copy)); Tcl_DecrRefCount(copy); } TclEmitPush( |