From d266b62e7ef7b5089c49452ed1307e90cd7ee899 Mon Sep 17 00:00:00 2001 From: Sebastian Gniazdowski Date: Tue, 25 Oct 2016 16:49:52 +0200 Subject: [PATCH] *highlight: Optimization: compress noglob-related code parse.zsh -oo, after changes: Running time: 1.8347470000 num calls time self name ----------------------------------------------------------------------------------- 1) 350 1827,26 5,22 100,00% 1354,88 3,87 74,14% -hsmw-highlight-process 2) 2800 335,45 0,12 18,36% 335,45 0,12 18,36% -hsmw-highlight-string 3) 2450 79,78 0,03 4,37% 79,78 0,03 4,37% -hsmw-highlight-check-path 4) 1400 39,59 0,03 2,17% 39,59 0,03 2,17% -hsmw-highlight-main-type 5) 350 9,61 0,03 0,53% 9,61 0,03 0,53% -hsmw-highlight-stack-pop 6) 350 7,94 0,02 0,43% 7,94 0,02 0,43% -hsmw-highlight-path-separators 7) 1 0,07 0,07 0,00% 0,07 0,07 0,00% -hsmw-highlight-fill-option-variables 8) 1 0,01 0,01 0,00% 0,01 0,01 0,00% -hsmw-highlight-init --- hsmw-highlight | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hsmw-highlight b/hsmw-highlight index 4c01599..daa92c7 100644 --- a/hsmw-highlight +++ b/hsmw-highlight @@ -305,9 +305,7 @@ __HSMW_HIGHLIGHT_TOKENS_TYPES=( style=unknown-token if (( this_word & BIT_start )); then in_array_assignment=0 - if [[ $arg == 'noglob' ]]; then - highlight_glob=0 - fi + [[ $arg == 'noglob' ]] && highlight_glob=0 fi # Compute the new $start_pos and $end_pos, skipping over whitespace in $buf.