summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authordearblue <[email protected]>2019-07-11 21:52:05 +0900
committerdearblue <[email protected]>2019-07-11 22:09:15 +0900
commit8c0d9ba1a363683bbeab8cb7c22acdb07621352d (patch)
tree11ddfa32f3f408b1d5220883e7a6857124dbe526 /test
parent5420895bcb14bdef8fd35d1abab09f63a003baed (diff)
downloadmruby-8c0d9ba1a363683bbeab8cb7c22acdb07621352d.tar.gz
mruby-8c0d9ba1a363683bbeab8cb7c22acdb07621352d.zip
Improve performance `String#index` with UTF-8
Based on Boyer-Moore-Horspool algorithm (Quick Search algorithm). As a side effect, the correct position is returned even if an invalid UTF-8 string is given. ```console % ./mruby@master -e 'p ("\xd1" * 100 + "#").index("#")' 50 % ./mruby@improve-index -e 'p ("\xd1" * 100 + "#").index("#")' 100 ``` The other behavior should be the same as the current implementation.
Diffstat (limited to 'test')
0 files changed, 0 insertions, 0 deletions