mirror of
https://github.com/zdharma-continuum/history-search-multi-word
synced 2025-02-16 11:08:23 +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
|
if [ "$#__hsmw_hcw_found" -eq "0" ]; then
|
||||||
# The repeat will make the matching work on a fresh heap arena
|
# The repeat will make the matching work on a fresh heap arena
|
||||||
repeat 1; do
|
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
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue