Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: improve substring ops with multi-byte chars #280

Merged
merged 1 commit into from
Nov 29, 2024

Conversation

reubeno
Copy link
Owner

@reubeno reubeno commented Nov 29, 2024

There is more to understand with respect to differences from bash's output, but with this change brush no longer generates an error when trying to slice into a string somewhere other than at a character boundary.

Copy link

Test Results

    2 files      9 suites   1m 16s ⏱️
  525 tests   525 ✅ 0 💤 0 ❌
1 038 runs  1 038 ✅ 0 💤 0 ❌

Results for commit 57fb43c.

Copy link

Performance Benchmark Report

Benchmark name Baseline (μs) Test/PR (μs) Delta (μs) Delta %
expand_one_string 3.43 μs 3.44 μs 0.00 μs ⚪ Unchanged
instantiate_shell 61.49 μs 60.75 μs -0.74 μs ⚪ Unchanged
instantiate_shell_with_init_scripts 30387.03 μs 30687.95 μs 300.92 μs ⚪ Unchanged
parse_bash_completion 2864.81 μs 2795.01 μs -69.79 μs 🟢 -2.44%
parse_sample_script 4.26 μs 4.18 μs -0.09 μs ⚪ Unchanged
run_echo_builtin_command 90.92 μs 90.82 μs -0.10 μs ⚪ Unchanged
run_one_builtin_command 107.97 μs 109.93 μs 1.96 μs ⚪ Unchanged
run_one_external_command 2016.01 μs 1946.68 μs -69.33 μs 🟢 -3.44%
run_one_external_command_directly 1007.92 μs 1007.36 μs -0.56 μs ⚪ Unchanged

Code Coverage Report: Only Changed Files listed

Package Base Coverage New Coverage Difference
brush-core/src/expansion.rs 🟢 96.53% 🟢 96.26% 🔴 -0.27%
Overall Coverage 🟢 74.57% 🟢 74.58% 🟢 0.01%

Minimum allowed coverage is 70%, this run produced 74.58%

@reubeno reubeno changed the title fix: slight improvements to string indexing with multi-byte chars fix: improve string indexing with multi-byte chars Nov 29, 2024
@reubeno reubeno changed the title fix: improve string indexing with multi-byte chars fix: improve substring ops with multi-byte chars Nov 29, 2024
@reubeno reubeno merged commit 48fc1ef into main Nov 29, 2024
17 checks passed
@reubeno reubeno deleted the slightly-better-string-index branch November 29, 2024 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant