diff options
author | Steve Bennett <steveb@workware.net.au> | 2011-06-26 21:57:32 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2011-07-07 21:34:35 +1000 |
commit | 0092ec06278144fcb8918f5e67be4597e7a8f664 (patch) | |
tree | 50a4fa469251b4f4dfedec9add5465117a0e8d45 | |
parent | 7ff7ff2e1c95d3bea5effbf1e8f0e8f401e2e625 (diff) | |
download | jimtcl-0092ec06278144fcb8918f5e67be4597e7a8f664.zip jimtcl-0092ec06278144fcb8918f5e67be4597e7a8f664.tar.gz jimtcl-0092ec06278144fcb8918f5e67be4597e7a8f664.tar.bz2 |
Tab and newline are common in text files
So optimize char [split] to include those chars too.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
-rw-r--r-- | jim.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -13793,13 +13793,13 @@ static int Jim_SplitCoreCommand(Jim_Interp *interp, int argc, Jim_Obj *const *ar * Optimise by sharing common (ASCII) characters */ Jim_Obj **commonObj = NULL; -#define NUM_COMMON (128 - 32) +#define NUM_COMMON (128 - 9) while (strLen--) { int n = utf8_tounicode(str, &c); #ifdef JIM_OPTIMIZATION - if (c >= 32 && c < 128) { - /* Common ASCII char */ - c -= 32; + if (c >= 9 && c < 128) { + /* Common ASCII char. Note that 9 is the tab character */ + c -= 9; if (!commonObj) { commonObj = Jim_Alloc(sizeof(*commonObj) * NUM_COMMON); memset(commonObj, 0, sizeof(*commonObj) * NUM_COMMON); |