From 0092ec06278144fcb8918f5e67be4597e7a8f664 Mon Sep 17 00:00:00 2001 From: Steve Bennett Date: Sun, 26 Jun 2011 21:57:32 +1000 Subject: [PATCH] Tab and newline are common in text files So optimize char [split] to include those chars too. Signed-off-by: Steve Bennett --- jim.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/jim.c b/jim.c index 1ec3e67..91873bd 100644 --- a/jim.c +++ b/jim.c @@ -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); -- 2.11.4.GIT