diff options
author | dgp <dgp@users.sourceforge.net> | 2003-08-27 21:31:05 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2003-08-27 21:31:05 (GMT) |
commit | 4323e0f274bdfce2d3c219cd26c84783fb1902df (patch) | |
tree | f49b1c0bc67f643719a05d246ff956b87bf4ef8b /generic/tclUtil.c | |
parent | c8cea779f14930d7be251801f4003224424f110d (diff) | |
download | tcl-4323e0f274bdfce2d3c219cd26c84783fb1902df.zip tcl-4323e0f274bdfce2d3c219cd26c84783fb1902df.tar.gz tcl-4323e0f274bdfce2d3c219cd26c84783fb1902df.tar.bz2 |
additional performance tweak to last commit.
Diffstat (limited to 'generic/tclUtil.c')
-rw-r--r-- | generic/tclUtil.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/generic/tclUtil.c b/generic/tclUtil.c index d939496..4321833 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.41 2003/08/27 20:29:36 dgp Exp $ + * RCS: @(#) $Id: tclUtil.c,v 1.42 2003/08/27 21:31:05 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; } |