mirror of
https://github.com/zdharma-continuum/history-search-multi-word
synced 2024-11-22 03:13:09 +00:00
Optimize searching in $history by 18-21%, via (R) index flag
This commit is contained in:
parent
84b7b4b7c8
commit
25d593ec29
1 changed files with 3 additions and 1 deletions
|
@ -70,7 +70,9 @@ _hsmw_main() {
|
|||
if [ "$#__hsmw_hcw_found" -eq "0" ]; then
|
||||
# The repeat will make the matching work on a fresh heap arena
|
||||
repeat 1; do
|
||||
__hsmw_hcw_found=( "${(@M)history:#(#i)*$~search_pattern*}" )
|
||||
# Tip: these are equal:
|
||||
#__hsmw_hcw_found=( "${(@M)history:#(#i)*$~search_pattern*}" )
|
||||
__hsmw_hcw_found=( "${(@)history[(R)(#i)*$~search_pattern*]}" )
|
||||
done
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in a new issue