]> git.lizzy.rs Git - rust.git/commit
utf8 validation: Compute block end upfront
authorUlrik Sverdrup <bluss@users.noreply.github.com>
Mon, 21 Nov 2016 22:26:31 +0000 (23:26 +0100)
committerUlrik Sverdrup <bluss@users.noreply.github.com>
Mon, 21 Nov 2016 22:26:31 +0000 (23:26 +0100)
commit20bd7f000fa788b9d38c5d664bb19b1ba38af850
tree2256c777d7d36306c60b23b1f47e34fa0a72072d
parent5a3aa2f73cbb08c6e41418c5378791fa24a66146
utf8 validation: Compute block end upfront

Simplify the conditional used for ensuring that the whole word loop is
only used if there are at least two whole words left to read.

This makes the function slightly smaller and simpler, a 0-5% reduction
in runtime for various test cases.
src/libcore/str/mod.rs