summaryrefslogtreecommitdiffstats
path: root/generic/tclUtil.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2003-08-27 21:31:53 (GMT)
committerdgp <dgp@users.sourceforge.net>2003-08-27 21:31:53 (GMT)
commit9b2e33c447fc19dd258a017e7fc1828c754a94a5 (patch)
tree47a99cb4d94b6d456598bdb7f9e9e820890fed0d /generic/tclUtil.c
parent5a18ec5dcd91fb4d266f78a72fc746153f9ae82a (diff)
downloadtcl-9b2e33c447fc19dd258a017e7fc1828c754a94a5.zip
tcl-9b2e33c447fc19dd258a017e7fc1828c754a94a5.tar.gz
tcl-9b2e33c447fc19dd258a017e7fc1828c754a94a5.tar.bz2
additinal performance tweak to last commit
Diffstat (limited to 'generic/tclUtil.c')
-rw-r--r--generic/tclUtil.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/generic/tclUtil.c b/generic/tclUtil.c
index fb86a03..8dfe0d9 100644
--- a/generic/tclUtil.c
+++ b/generic/tclUtil.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: tclUtil.c,v 1.36.2.3 2003/08/27 20:09:49 dgp Exp $
+ * RCS: @(#) $Id: tclUtil.c,v 1.36.2.4 2003/08/27 21:31:53 dgp Exp $
*/
#include "tclInt.h"
@@ -2038,13 +2038,24 @@ TclNeedSpace(start, end)
* backslash.
*/
+ if (*end > 0x20) {
+ /*
+ * Performance tweak. All ASCII spaces are <= 0x20. So get
+ * a quick answer for most characters before comparing against
+ * all spaces in the switch below.
+ *
+ * NOTE: Remove this if other Unicode spaces ever get accepted
+ * as list-element separators.
+ */
+ return 1;
+ }
switch (*end) {
case ' ':
- case '\f':
+ case '\t':
case '\n':
case '\r':
- case '\t':
case '\v':
+ case '\f':
if ((end == start) || (end[-1] != '\\')) {
return 0;
}