summaryrefslogtreecommitdiffstats
path: root/generic/tclBasic.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2005-05-05 18:37:43 (GMT)
committerdgp <dgp@users.sourceforge.net>2005-05-05 18:37:43 (GMT)
commit06ccaebaafb55508004011a0cb9ec73a6872c23b (patch)
tree528333d487c2d5ed865f278d50536ea98959741c /generic/tclBasic.c
parent9c427bf1e80bcbb05860cb838266240040b91f07 (diff)
downloadtcl-06ccaebaafb55508004011a0cb9ec73a6872c23b.zip
tcl-06ccaebaafb55508004011a0cb9ec73a6872c23b.tar.gz
tcl-06ccaebaafb55508004011a0cb9ec73a6872c23b.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:
Diffstat (limited to 'generic/tclBasic.c')
-rw-r--r--generic/tclBasic.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index 376fe25..9783367 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -13,7 +13,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclBasic.c,v 1.149 2005/05/03 18:07:45 dgp Exp $
+ * RCS: @(#) $Id: tclBasic.c,v 1.150 2005/05/05 18:37:55 dgp Exp $
*/
#include "tclInt.h"
@@ -2822,6 +2822,14 @@ Tcl_ListMathFuncs(interp, pattern)
Tcl_HashSearch hSearch;
CONST char *name;
+ if ((pattern != NULL) && TclMatchIsTrivial(pattern)) {
+ if ((Tcl_FindHashEntry(&iPtr->mathFuncTable, pattern) != NULL)
+ && (Tcl_ListObjAppendElement(interp, resultList,
+ Tcl_NewStringObj(pattern,-1)) != TCL_OK)) {
+ goto error;
+ }
+ return resultList;
+ }
for (hPtr = Tcl_FirstHashEntry(&iPtr->mathFuncTable, &hSearch);
hPtr != NULL; hPtr = Tcl_NextHashEntry(&hSearch)) {
name = Tcl_GetHashKey(&iPtr->mathFuncTable, hPtr);
@@ -2829,6 +2837,7 @@ Tcl_ListMathFuncs(interp, pattern)
/* I don't expect this to fail, but... */
Tcl_ListObjAppendElement(interp, resultList,
Tcl_NewStringObj(name,-1)) != TCL_OK) {
+error:
Tcl_DecrRefCount(resultList);
return NULL;
}