From 56aa7592b7c3779cadd24aa586b0d37382902bb3 Mon Sep 17 00:00:00 2001 From: Sebastian Gniazdowski Date: Tue, 25 Oct 2016 17:47:48 +0200 Subject: [PATCH] *highlight: Optimization: compress code handling braces, always block parse.zsh -oo, after changes: Running time: 1.7983390000 num calls time self name ----------------------------------------------------------------------------------- 1) 350 1790,84 5,12 99,99% 1316,27 3,76 73,50% -hsmw-highlight-process 2) 2800 335,29 0,12 18,72% 335,29 0,12 18,72% -hsmw-highlight-string 3) 2450 80,24 0,03 4,48% 80,24 0,03 4,48% -hsmw-highlight-check-path 4) 1400 41,35 0,03 2,31% 41,35 0,03 2,31% -hsmw-highlight-main-type 5) 350 9,70 0,03 0,54% 9,70 0,03 0,54% -hsmw-highlight-stack-pop 6) 350 7,99 0,02 0,45% 7,99 0,02 0,45% -hsmw-highlight-path-separators 7) 1 0,09 0,09 0,01% 0,09 0,09 0,01% -hsmw-highlight-fill-option-variables 8) 1 0,01 0,01 0,00% 0,01 0,01 0,00% -hsmw-highlight-init --- hsmw-highlight | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hsmw-highlight b/hsmw-highlight index 0001d7c..a9137ec 100644 --- a/hsmw-highlight +++ b/hsmw-highlight @@ -543,10 +543,8 @@ __HSMW_HIGHLIGHT_TOKENS_TYPES=( # tt(IGNORE_BRACES) option nor the tt(IGNORE_CLOSE_BRACES) option is set.""" if (( right_brace_is_recognised_everywhere )); then -hsmw-highlight-stack-pop 'Y' style=reserved-word - if [[ $style == reserved-word ]]; then - (( next_word = next_word | BIT_always )) - fi - else + [[ $style == reserved-word ]] && (( next_word = next_word | BIT_always )) + #else # Fall through to the catchall case at the end. fi ;|