mirror of
https://gitee.com/openharmony/third_party_rust_regex
synced 2025-04-14 08:30:18 +00:00

This was using `Vec::extend` to accumulate bytes in a buffer, but this compiles down to less efficient code than, say, `Vec::extend_from_slice`. However, that method is newly available as of Rust 1.6, so we do a small backport to regain performance. This bug was noticed by @llogiq here: https://github.com/TeXitoi/benchmarksgame-rs/issues/31 In particular, this increases the performance of bytes::Regex two-fold on that benchmark.